JS in the window.onload and in the onload attribute at the same time __js

Source: Internet
Author: User
Tags anonymous

Transferred from http://topic.csdn.net/u/20100608/14/aa805ed6-0820-47c7-b866-6dd93d90ea67.html (10/F)

In case one, the function specified by window.onload is anonymous, only the latter is executed, and the action is the latter action. Such as:

 

----Display: ACD
In case two, the function specified by window.onload is not anonymous, it is executed, preceded by the latter. Such as:

 

----display in turn: Abd
Window.onload in <BODY>
Case three, the window.onload specified function is anonymous, only the latter is performed, but the former action is the former. Such as:

 

----Display in turn: BDC
In case four, the window.onload specified function is not anonymous, it is executed, the former is better than the latter. Such as:

 

----Display in turn: BDA


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.