Javad.Kashi
پنج شنبه 11 فروردین 1390, 01:14 صبح
سلام
در این آدرس (http://addyosmani.com/blog/8-jquery-performance-tips/) مقایسه ای بین widnow.load و document.load صورت گرفته و نتیجه تا آنجا که من فهمیدم این بود که window بهتر و بهینه تر است.
سوال من اینه که فرق اصلی این دو چیست ؟
و نظر شما اساتید در مقایسه این دو چیست؟
این هم متن :
Document.ready isn’t a terrible thing, but it’s a habit that many developers still have including myself occasionally. It doesn’t matter where you’re using $(function(){}); or the full version of this, but truth be told it is significantly more optimal to be using Window.load in your applications.
The reason behind this idea is that document.ready happens during page render while objects are still downloading and that cause some stalls in your page. You don’t want that. You can however reduce the CPU utilization during the page load by binding your jQuery functions to the $(window).load event – it occurs after all objects called by the HTML have fully completed downloading.
That’s one line change that can give you scripts that little extra performance boost!.
یا علی
در این آدرس (http://addyosmani.com/blog/8-jquery-performance-tips/) مقایسه ای بین widnow.load و document.load صورت گرفته و نتیجه تا آنجا که من فهمیدم این بود که window بهتر و بهینه تر است.
سوال من اینه که فرق اصلی این دو چیست ؟
و نظر شما اساتید در مقایسه این دو چیست؟
این هم متن :
Document.ready isn’t a terrible thing, but it’s a habit that many developers still have including myself occasionally. It doesn’t matter where you’re using $(function(){}); or the full version of this, but truth be told it is significantly more optimal to be using Window.load in your applications.
The reason behind this idea is that document.ready happens during page render while objects are still downloading and that cause some stalls in your page. You don’t want that. You can however reduce the CPU utilization during the page load by binding your jQuery functions to the $(window).load event – it occurs after all objects called by the HTML have fully completed downloading.
That’s one line change that can give you scripts that little extra performance boost!.
یا علی