1. The settimeout () method is used to call a function or evaluate an expression after a specified number of milliseconds.
SetTimeout () executes only one code at a time. If you want to call more than once, use SetInterval () or let code itself call SetTimeout () again.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
The 2.setInterval () method can call a function or a calculation expression in the specified period (in milliseconds).
The SetInterval () method keeps calling the function until the clearinterval () is called or the window is closed. The ID value returned by SetInterval () can be used as an argument to the Clearinterval () method.
below to introduce you to the relevant reading
The 1.setInterval () function can refer to the SetInterval () section of the functional usage.
2.location.href can refer to the HREF attribute section of the Location object.
The 3.innerHTML attribute can refer to the usage section of the innerHTML property of JS.
The following example (example) to introduce you:
The problems encountered:
When the above JS method is placed on the $ (function () {...}) , the browser will report METHODXX () is not defined;
The definition of function () {} should be placed in <script></script>
The above is a small set to introduce the JavaScript implementation time countdown jump (recommended), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!