首页 > 编程语言 > 详细

onload in JavaScript

时间:2019-06-27 11:05:26      阅读:115      评论:0      收藏:0      [点我收藏+]

https://www.w3schools.com/tags/ev_onload.asp

Example

Execute a JavaScript immediately after a page has been loaded:

<body onload="myFunction()">

 

 

Definition and Usage

The onload attribute fires when an object has been loaded.

onload is most often used within the <body> element to execute a script once a web page has completely loaded all content (including images, script files, CSS files, etc.). However, it can be used on other elements as well (see "Supported HTML tags" below).

The onload attribute can be used to check the visitor‘s browser type and browser version, and load the proper version of the web page based on the information.

The onload attribute can also be used to deal with cookies (see "More Examples" below).

 

Supported HTML tags: <body>, <frame>, <frameset>, <iframe>, <img>, <input type="image">, <link>, <script> and <style>

 

 

 


onload in JavaScript

原文:https://www.cnblogs.com/chucklu/p/11095752.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!