JS Funciton Summary

Source: Internet
Author: User

1. The window each time loading window.location.reload () or tagged <meta http-equiv= "refresh" content= "1" > for one second automatically refresh, used in some real-time display of the site such as stocks.

2. Forward and backward, Window.history.forward () Window.history.back ()

3. After a few seconds auto-close, set a flag, and then add an event on the body to change the flag, if the event triggers the RESET flag

var true ; function Clickbody () {      false;    } Setinrerval (function() {       if(willclose) {window.close ()}else true }},10000)    
View Code

4. Modify the page title, Document.title = value.

5. Dynamic Loading JS,

function () {     var thehead = Document.getelementbytagname (' head '). Item (0);      var myScript = document.createelement (' script ');      = '     = ' text/javascript '     true;   After the set load is complete, parse execution }
View Code

6. Determine if the page is loaded, window.onload but the page load is complete including the load is complete, but we may need to complete the document loading, then use document onreadystatechange Monitoring

Document.onreadystatechange = myonload;     function myonload () {        if(document.readystate = = ' complete ') {            alert (' document Loaded ')        }    }
View Code

JS Funciton Summary

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.