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>!