It seems that helloworld.js loads several times depending on the number of times I #load . I say this because when I look at the Google Tools Chromes Developer Tools Network tab, it shows helloworld.js as many times as I #load .
$(document).ready(function() { $("#load").click(function(){ $.getScript('helloworld.js', function() { hello(); }); }); });
The hello() function is as follows:
function hello(){ alert("hello"); }
Is it possible to determine if helloworld.js ?
So, if it is not downloaded, download it, and if it is downloaded, do not download it.
This is what the developer tools show if I press the #load button 4 times:

oshirowanen
source share