How to make JavaScript execute after page load?

前端 未结 24 2318
孤城傲影
孤城傲影 2020-11-21 05:55

I\'m executing an external script, using a

24条回答
  •  余生分开走
    2020-11-21 06:20

    document.onreadystatechange = function(){
         if(document.readyState === 'complete'){
             /*code here*/
         }
    }
    

    look here: http://msdn.microsoft.com/en-us/library/ie/ms536957(v=vs.85).aspx

提交回复
热议问题