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
Post a Comment