Jquery - if page loaded

后端 未结 9 1690
[愿得一人]
[愿得一人] 2021-02-05 15:57

Is there any trick how to start a function in javascript, which starts when the page is completely loaded?

9条回答
  •  野性不改
    2021-02-05 16:28

    When DOM is ready then use .ready event.

    jQuery(document).ready(function(){
      //content
    });
    

    you also use .load event when page load images.

    jQuery(window).load(function(){
      //content
    });
    

提交回复
热议问题