How to make JavaScript execute after page load?

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

I\'m executing an external script, using a

24条回答
  •  没有蜡笔的小新
    2020-11-21 06:19

    If you are using jQuery,

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

    is equivalent to

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

    or another short hand:

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

    See What event does JQuery $function() fire on? and https://api.jquery.com/ready/

提交回复
热议问题