The page is automatically refreshed. You do not need to press the Enter key to submit data!

Source: Internet
Author: User

If the page needs to be automatically refreshed, but the page has Request. Form, a prompt box is usually displayed, and you need to confirm to submit the data. This is not an automatic refresh. For monitoring or stock display, it is important not to intervene by the user. The problem can be solved below:

<Script Language = "JavaScript">
<! --
Var limit = "0: 60" // defines the refresh time

If (document. images ){
Var parselimit = limit. split (":")
Parselimit = parselimit [0] * 60 + parselimit [1] * 1
}
Function beginrefresh (){
If (! Document. images)
Return
If (parselimit = 1 ){
InputDate. action = "TypeAlert. asp" // This is the name of the page. Do not forget that there should be a Form outside. Use the hidden space to keep the data of the Request. Form required for this page!
InputDate. submit ()
}
Else {
Parselimit-= 1
Curmin = Math. floor (parselimit/60)
Cursec = parselimit % 60
If (curmin! = 0)
Curtime = curmin + "Minute" + cursec + "second to refresh this page! "
Else
Curtime = cursec + "refresh this page in seconds! "
Window. status = curtime
SetTimeout ("Maid ()", 1000)
}
}

Window. onload = beginrefresh
// -->
</Script>

This section is to be added to the <HEAD>!

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.