Home > Web Front-end > JS Tutorial > How to write Javascript in jsp

How to write Javascript in jsp

青灯夜游
Release: 2023-01-07 11:41:42
Original
6287 people have browsed it

Method: 1. Write JavaScript code directly in the "<script></script>" tag pair; 2. Write JavaScript code in a js file, using "" statement imports the js file into the jsp page.

How to write Javascript in jsp

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

There are two ways to write JavaScript scripts in JSP pages:

1. Write JavaScript directly in the <script></script> tag Code

<script type="text/javascript">
function test(){
alert("test");
}
</script>
Copy after login

2. Write it in a js file, and then introduce it into the page through the src attribute of the

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template