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.
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>
2. Write it in a js file, and then introduce it into the page through the src attribute of the