Jquery - if page loaded

后端 未结 9 1675
[愿得一人]
[愿得一人] 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:27

    To call a method once the document is loaded completely use

    $(document).ready(function(){
      ...
    });
    

    Or else if page is loading through an ajax call use

    $('#containerdiv').load('samplepage.jsp', function() {
      alert("ajax load complet.."); 
    });
    

提交回复
热议问题