Reputation: 3143
I am making a script where my jquery loads a jquery plugin with the getScript() method. But for some reason the code that I load only works after my script has ended.
So the procedure:
Upvotes: 1
Views: 185
Reputation: 3212
The getScript()-method retrieves the script asynchronous, so you have to wait till it has loaded (usually through the success()-method) to call it. I guess you're not doing that.
So try
getScript("script").success(function() {
$('#test').myPlugin();
});
Upvotes: 1