onload in JavaScript

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

Example

Execute a JavaScript immediately after a page has been loaded:

<body onl oad="myFunction()">

 

 

Definition and Usage

The onl oad 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 onl oad 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 onl oad 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>

 

 

 


上一篇:[转载]Trace32 symbol 路径调整


下一篇:php composer.phar 抛出异常