1
Vote

Wrap all JavaScript function inside one anonymous function.

description

It should be like this.
 
(function (module, $, undefined)
{
var localVariable1, localVariable2, localVariable3;
 
function localFunction()
{
 
}
 
module.publicFunction = function ()
{
 
}
} (window.moduleName = window.moduleName || {}, jQuery));

comments