javascript - Use of $(document).ready() function -


what disadvantages of defining (not declaration) functions in

$(document).ready() 

while developing large web application of javascript/jquery have number of ajax calls end services.

for example: when add ajax calls in document.ready , calls going download large number of data while page loading disadvantages experience doing ??

thanks

since saying functions defined, not declared, inside .ready call assume code this:

var fn; // declaration $(document).ready(function () {   fn = function () { // definition     //   }; }); 

the main disadvantage cannot call functions before dom tree ready. if try call them earlier error.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -