jQuery load event

Loading event

Javascript loading event:

##


## jquery loading event implementation
① $(document).ready(function processing);

② $().ready( function processing);

③ $(function processing); It’s just an encapsulation of the first type of loading

   php.cn     


The difference between jquery loading events and traditional loading events

Setting number

In the same request, jquery Multiple settings can be set, but only one can be set in the traditional way.

The traditional way of loading events is to assign a value to the onload event attribute. If assigned multiple times, the latter will overwrite the former.

The jquery method of loading events is to store each loading event in an array and become an element of the array. When executing, just traverse the array and execute each element, so it can set multiple loading events. .

The execution timing is different

The traditional loading event is to execute the loading event after all the content (text, pictures, styles) is displayed in the browser.

jquery loading event is executed as soon as all the content (text, pictures, styles) is drawn in the corresponding DOM tree structure in the memory. It is possible that the corresponding content has not yet been displayed in the browser.

   php.cn     

加载事件区别



Continuing Learning
||
php.cn
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!