How to delay calling of javascript function?

后端 未结 5 2064
野性不改
野性不改 2020-11-29 06:09

I\'m new to JavaScript.

I would like to call JavaScript / jQuery function after the page load in aspx page.

I tried using

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 06:36

    If you want to be 100% sure that it's when the page ACTUALLY loads, use:

    $(window).load(function(){
       //After EVERYTHING loads, including images.
    })
    

    The other's solution, onload works, but it loads once the DOM is ready, but not when the window is actually finished loading.

提交回复
热议问题