How to make JavaScript execute after page load?

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

I\'m executing an external script, using a

24条回答
  •  臣服心动
    2020-11-21 06:07

    As Daniel says, you could use document.onload.

    The various javascript frameworks hwoever (jQuery, Mootools, etc.) use a custom event 'domready', which I guess must be more effective. If you're developing with javascript, I'd highly recommend exploiting a framework, they massively increase your productivity.

提交回复
热议问题