Why Javascript Files Are Loading Twice Console.log And Alert And Jquery "click" Is Running Twice
why javascript files are loading twice twice? $(window).load(function() { $(function() { console.log('hi'); }); }); this is the console output: both the vm and the
Solution 1:
Your problem is that Categories.js
and all other scripts placed in the body
are loaded two times, once by the script
tag and another time by jQuery using AJAX.
The reason for that is, that you have script
tags in the body
of your site in combination with the line 118
in scrollingPage.js
:
$('body').wrapInner('<div id="superContainer" />');
Possible solutions:
- update to jQuery 1.9+ if possible
- move your scripts from
body
to the head - remove them from the
body
before the code ofscrollingPage.js
is executed
Solution 2:
$(window).load( function() { console.log('hi'); });
Post a Comment for "Why Javascript Files Are Loading Twice Console.log And Alert And Jquery "click" Is Running Twice"