" tag pair; 2. Write JavaScript code in a js file, using "" statement to import the js file into the jsp page."/> " tag pair; 2. Write JavaScript code in a js file, using "" statement to import the js file into the jsp page.">

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

How to write Javascript in jsp

青灯夜游
青灯夜游Original
2021-07-01 17:42:306258browse

Method: 1. Write JavaScript code directly in the "3f1c4e4b6b16bbbd69b2ee476dc4f83a2cacc6d41bbb37262a98f745aa00fbf0" tag pair; 2. Write JavaScript code in a js file, using "1588ff67b3b1d03b0ffdd44bb73633f62cacc6d41bbb37262a98f745aa00fbf0" 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 3f1c4e4b6b16bbbd69b2ee476dc4f83a2cacc6d41bbb37262a98f745aa00fbf0 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 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag

<script type="text/javascript" src="json.js" ></script>

For more programming-related knowledge, please visit:Programming getting Started! !

The above is the detailed content of How to write Javascript in jsp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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