Global variable are not allowed !!

item-feedback

#1

please help, i am using canvas but my item became soft rejected because this in screenshot:
http://envato.d.pr/2stm

the recommended look at this:


how can i fix it?
thnx in advanced


#2

Hi,

Insert all your code into:

(function() {
  

})();

If your scripts are complex and require a global variable outside the above block use this function to get the vars:

(function() {
       //YOUR GLOBAL VARS HERE
       var global-one;
       var global-two;

       $.fn.getGlobalVar = function (name) {
        return eval(name);
     };
})();

And to read the values use:

$.fn.getGlobalVar("VARIABLE NAME"); //Example $.fn.getGlobalVar("global-one");


#3

ok i will ty it , thank you