The timer
- SetTimeout (function(){},ms)
- ClearTimeout (t1)(ps:t1 is the timer name)
- SetTimeout involves the task queue, when the timer set the number of milliseconds is 0, will not be executed immediately, will first put him in a task queue, to perform tasks on the main thread, the main thread after the task, check the timer task queue, if the specified waiting time, if to perform a task queue timer function
setTimeout(function(){// Async console.log(1)},0); console.log(2); console.log(3); <! The output is 2, 3, 1--> <! --setTimeout this method is used to start the timer as soon as the page is opened -->Copy the code
- SetInterval (function(){},ms)
- Clear timer clearInterval(T1)
History Historical records
- History.forward () goes to the next page
- History.go (1) goes to the next page
- History.back () returns to the previous page
- History.go (-1) returns to the previous page
- Go (number) directly to the number page
A Label hop problem
- Don’t jump
- href=”#”
- href=”javascript:void(0)”
<a href="#">1</a></br>
<a href="javascript:void(0)">2</a></br>
Copy the code
- Jump to new page (original page still exists)
- href=”www.baidu.com/” target=”_blank”
<a href="https://www.baidu.com/" target="_blank"> baidu < / a > < / br >Copy the code