Here I am facing an issue with jquery holdReady .
$.holdReady(true);
$.getScript("someXJqueryPlugin.js", function() {
$.holdReady(false);
});
In my ready function
$(document).ready(function(){
someFunctionFromMyPlugin();
});
Because of someXJqueryPlugin.js
is some what bigger in size .So i am trying to delay the the ready function untill my plugin loaded.
Still iam getting the error someFunctionFromMyPlugin not a function .
Any hints ??What I am missing ?? please help .
Thanks in advance.
Here I am facing an issue with jquery holdReady .
$.holdReady(true);
$.getScript("someXJqueryPlugin.js", function() {
$.holdReady(false);
});
In my ready function
$(document).ready(function(){
someFunctionFromMyPlugin();
});
Because of someXJqueryPlugin.js
is some what bigger in size .So i am trying to delay the the ready function untill my plugin loaded.
Still iam getting the error someFunctionFromMyPlugin not a function .
Any hints ??What I am missing ?? please help .
Thanks in advance.
I'd suggest placing the document ready inside of the done callback.
$.getScript(url,function(){
$(document).ready(function(){
// do stuff
});
});
or using deferreds:
$.when( $.getScript(url), $.ready ).done(function(){
// do stuff
});
Note $.ready
is not documented and is subject to change, you can replace it with the following for a more stable version:
$.when( $.getScript(url), $.Deferred(function(def){
$(def.resolve);
})).done(function(){
// do stuff
});