Posts by mimo

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

I have to agree, this looks extremely spammy and amateurish.

+100

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Thank you EugeneO. I have seen for example infinitescroll plugin js do this ,

(function($) { “use strict”;

//Plugin functions })(jQuery);

So for this reason i thought that was the correct way to do things.

Best Regards

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Well i love to hear this, then all my functions are ok, and my site works great. I was trying to make things work in that way with no luck.

As tommus has flagged this to get a staff reply, let’s wait to see what they say about this.

Best Regards

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Hi, thank you OriginalEXE for the answers, but what we were talking about was just that.

Look at the fiddle Tommus has linked, it is exactly the same example as yours but i think this cannot be done know because of the New Theme Requirements say that all js from Author must be enclosed in a function scope like:

(function($) { “use strict”;

//Author Code

})(jQuery);

I think just to prevent issues with other libraries and plugins. Or, are we missing something??

:):) Thank you

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Why don’t you try to use “use strict”; for the whole document instead putting it inside of every function? line 1: “use strict”; line 2: your code…

That was the first thing i did, then all the functions get undefined

Regards

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Thank you. Just to clarify i would ask some questions:

All js means all js when enclosing it in (function($) { “use strict”;

//Author Code

})(jQuery);

???

so i need to do:

(function($) { “use strict”;

//Author Code With my function

})(jQuery);

In other file when needed for example:

(function($) { “use strict”; $(document).ready(function(){ //Call my function }); })(jQuery);

Is this the needed structure?

I am only asking because i just have tried to make this work for hours, well, you know, change this, look google, change that, look google, change the other and no luck at all. Have read all the poor documentation available about “use strict”; and i am a bit confused.

Have inspected some very well known scripts written in that way, working perfectly, so i may be missing something important to make mines work in this way.

So the important question for me is how i have to rewrite my functions written in the mode TommusRhodus has linked in fiiddle, to work in this way???

:) Thank you very much

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Hi, yes, of course this works, but as it said in theme requirements all js must be inside (function($) { “use strict”;

//Author Code

})(jQuery);

The fiddle you have linked works because the only difference is the “use strict”; at the begining, but the code is not enclosed in the (jQuery) function as needed.

Or i am losing something with Theme Requirements?

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

hi tommus, thank you very much for your answer.

I think i am lost in the organization of files and functions or something

Let’s say i have:

(function($) { “use strict”; function myfunction(){

some code

}; })(jQuery);

Then in other file i have your code: jQuery(document).ready(function($) { ‘use strict’; myfunction(); });

this doesn’t work for me, it gives undefined function

Thank you very much

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

Hi, i have read the new Theme submissions Requirements that say:

All JavaScript should be written with “use strict” mode on. For example, you can do this with jQuery as follows:

(function($) { “use strict”; // Author code here })(jQuery);

When i enclose my js file this way, all my functions stop working, undefined

Site is working perfectly if i leave my functions as they are.

I declare global functions like this:

function thefunction(){ //My code }

Then access them with

thefunction();

I have read tons of documentation about this with no luck, Could someone point me in the right direction about how to declare my functions and then access them for example when document ready ???

Really lost :(

30 posts
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Europe
mimo says

hi,

i am spanish. what i think is one of the most valuable things here is people, way of living, also the sun, the mediterranean sea, party and perfect beaches.

Just the perfect place to have a good time, make friends and enjoy. I am not sure if you will want to go home once you stay here for a week :)

Best Regards.

by
by
by
by
by
by