How to make JavaScript execute after page load?

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

I\'m executing an external script, using a

24条回答
  •  [愿得一人]
    2020-11-21 06:02

    These solutions will work:

    
    

    or

    document.onload = function ...
    

    or even

    window.onload = function ...
    

    Note that the last option is a better way to go since it is unobstrusive and is considered more standard.

提交回复
热议问题