js notes (5) - location of usage

!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
</style>
<Script> 
    the setInterval ( "goto_baidu ()", 1000); // beginning requires only one second stop execution of the function, one second to perform a function 
    var t =. 5; // define the time t is equal to 5 seconds; 
  function goto_baidu () {
       IF (T == 0 ) {
        location.href="http://www.baidu.com" ;
      }
 document.getElementById("show").innerHTML=t;
T -; // perform a time minus a 
}
 </ Script>
<body>
  <! - In order to solve the bug on the second timer, as defined above, t is 5 seconds, but setInterval ( "goto_baidu ()", 1000) was performed to wait for one second, so the label 6 there is provided the more coherent web - ->
    <Label> well </ label> <span id = "show"> 6 </ span> <label> seconds, jump to Baidu! </ Label>

</body>
</html>

 

Guess you like

Origin www.cnblogs.com/hmy-666/p/11937920.html