Currently scheduled operations include:
1. Refresh on the Html page regularly (Refresh)
1. Refresh (refresh) code usage instructions
Description: How long (seconds) to refresh yourself, or how long after the web page automatically links to other web pages.
Usage: <Meta http-equiv="Refresh" Content="30">
<Meta http-equiv="Refresh" Content="5; Url=//www.Vevb.com">
Note: 5 of them means that you will automatically refresh to the URL after staying for 5 seconds.
2. How to operate regularly
You can refresh repeatedly on the same page to achieve the effect of timing operations.
For example: <meta http-equiv="refresh" content="5;URL=//www.Vevb.com">
Disadvantages: You must open the page in the browser, and cannot close it.
2. SetTimeout and setInterval in Javascript
1. The difference between setTimeout and setInterval
There are two main timing methods for window objects, namely setTimeout and setInteval. Their syntax is basically the same, but the completed functions are different.
The setTimeout method is a timed program, that is, at what time to do. After finishing it, it will be over.
The setInterval method means that a certain operation is repeatedly executed during a certain interval.
If you use setTimeout to implement the function of setInterval, you need to call yourself regularly in the executed program. If you want to clear the counter, you need to call different clear methods according to the method used:
For example: tttt=setTimeout('hello()',1000);
clearTimeout(tttt);
or:
tttt=setInterval('hello()',1000);
clearInteval(tttt);
2. How to operate regularly
For example, you need to open the page Test.asp regularly (of course, Test.asp can be a reading database and generating static pages...)
The code copy is as follows:
<script language="JavaScript" type="text/javascript">
<!--
function hello(){
window.open('Http://www.Vevb.com')
}
window.setTimeout(hello(),5000);
//-->
</script>
Disadvantages: You must open the page in the browser, and cannot close it.
3. ASP uses VB writing timing components
There are no timing statements like setTimeout in ASP. We need to use ASP components to solve them. Similarly, VB6 can be used to compile them. For specific operation methods, please refer to
The previous component is used to hang threads. In order to suspend threads, we need to use the WIN32API function Sleep, and also create a new Active Dll project, named Timer.
The class name is sleep.
The WIN32 API function sleep can be found in the API text browser provided by VB6.
Now the sleep-like program is as follows. This component program is very simple, I won’t explain it much.
The code copy is as follows:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private m_set As Long
Public Property Get setup() As Long
setup = m_set
End Property
Public Property Let setup(strset As Long)
m_set = strset
End Property
Public Function Sleeptime()
Sleep (setup)
End Function
Compile it and generate the timer.dll component dll. If you don't know how to write VB programs, you can also find timer.dll in the downloaded file package