Home > Web Front-end > JS Tutorial > JS gets the request value and automatically executes the usage example_javascript skills

JS gets the request value and automatically executes the usage example_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:58:30
Original
1033 people have browsed it

There are three common methods for automatically executing JS functions in web pages
In the Head area in HTML, there are the following functions:

Copy code The code is as follows:



Next, we will focus on the above function and let it be loaded on the web page run automatically!
①The first method
Change the above code to:
Copy the code The code is as follows:



②Second method
Modify the Body of the web page to:
Copy the code The code is as follows:



Or change to:
Copy code The code is as follows:



③The third method
Use JS timer to execute functions intermittently:
Copy code The code is as follows:

setTimeout("MyAutoRun()",1000); //Execute the MyAutoRun() function every 1000 milliseconds

To implement the method, change the top JS function to:
Copy code The code is as follows:



Other methods are more special, not commonly used, and not very versatile, so I won’t introduce them!
EL& JSTL can also be used in JS
Copy code The code is as follows:

var step = "";
switch(step) {
case"0":
default:
break ; var step = "";
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
laravel request processing
From 1970-01-01 08:00:00
0
0
0
Request desktop background
From 1970-01-01 08:00:00
0
0
0
PHP sends query request
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template