" tag; 2. Introduce it through the src attribute of the script tag, with the syntax ""."/> " tag; 2. Introduce it through the src attribute of the script tag, with the syntax "".">
search
HomeWeb Front-endJS TutorialWhat tags do you use to write javascript in jsp?

In jsp, use script tag to write javascript code. The writing method is: 1. Write directly in the "<script></script>" tag; 2. Introduction through the src attribute of the script tag, the syntax is "> ;".

What tags do you use to write javascript in jsp?

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

In addition to JSP predefined actions, developers can also use the JSP tag extension API to add their custom actions. You can use the <script> tag in jsp to add JavaScript code. </script>

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

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

<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 <script> tag<br/></script>

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

The difference between JavaScript and jsp:

jsp technology is web The server-side technology of the website can be simply understood as jsp technology, which is used to generate dynamic web pages. Ordinary web pages are html, which are static and need to be written in html language in advance.

Then we add some java code to the html page and insert the dynamic content of the java code part into the original html page. Then, this page can become a jsp page. That is, jsp=htmljava.

Javascript is the client-side technology of the web. It is a scripting language that does not require compilation and is interpreted and executed by the browser. It is also inserted into the html page. The execution of javascript scripts is event-driven.

When the browser loads the HTML page and the user clicks on the button or text box on the page, if the page has written event JavaScript scripts for these buttons or text boxes, then the user is responding The execution of these scripts will be triggered when an action is taken. JavaScript scripts can respond to client actions without communicating with the server.

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What tags do you use 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
jsp是属于前端还是后端jsp是属于前端还是后端Jan 28, 2023 pm 06:23 PM

jsp属于后端。jsp的本质是一种servlet,而servlet又是服务器端的java应用程序,所以jsp是属于后端的技术。JSP部署于网络服务器上,可响应客户端发送的请求,并根据请求内容动态地生成HTML、XML或其他格式文档的Web网页,然后返回给请求者。JSP技术以Java作为脚本语言,为用户HTTP请求提供服务,并能与服务器上的其它Java程序共同处理复杂的业务需求。

SpringBoot项目如何整合JSPSpringBoot项目如何整合JSPMay 12, 2023 pm 07:40 PM

新建好springboot项目以后目录如下:第一步:在项目的pom文件中加入配置jsp所需要的jar包代码:org.apache.tomcat.embedtomcat-embed-jasperprovided第二步:在main路径下新建目录webapp,在webapp下新建路径WEB-INF,在WEB-INF下新建路径jsp,在这个路径下放置我们要使用的jsp文件第三步:在主配置文件中配置jsp文件的访问路径和后缀代码:spring.mvc.view.prefix=/WEB-INF/jsp/sp

jsp分页功能怎么实现jsp分页功能怎么实现Mar 04, 2024 pm 04:40 PM

实现步骤:1、在JSP页面中引入JSTL标签库;2、从数据库中获取数据;3、对数据进行分页处理;4、在页面中显示分页导航条;5、根据当前页码和每页显示数量,从分页后的数据中获取对应的数据并显示在页面上即可。

jsp和html区别在哪jsp和html区别在哪Jan 09, 2024 am 10:46 AM

jsp和html区别:1、运行机制;2、用途;3、与Java的关系;4、功能;5、与后端的关系;6、速度;7、可维护性和扩展性;8、学习和使用的难易程度;9、文件后缀和识别工具;10、社区和支持;11、安全性。详细介绍:1、运行机制,HTML是一种标记语言,主要用于描述和定义网页的内容,它运行在客户端,由浏览器解释执行,JSP是一种动态网页技术,运行在服务器端等等。

如何用jsp+mysql实现网页的分页查询如何用jsp+mysql实现网页的分页查询May 30, 2023 pm 03:58 PM

一、实现分页查询的核心sql语句(1)查询数据库的记录总数的sql语句:selectcount(*)from+(表名);(2)每次查询的记录数的sql语句:其中:0是搜索的索引,2是每次查找的条数。select*from表名limit0,2;二、代码实现*上篇写过这两个类,DBconnection类:用于获取数据库连接,Author对象类。这两个类的代码点击连接查看。点击链接查看DBconnection类和Author对象类(1)登录页面:index.jsp。Inserttitlehere用户列

jsp是什么格式的文件jsp是什么格式的文件Jan 24, 2024 pm 04:01 PM

​JSP是一种动态网页技术标准,其文件格式是在传统的网页HTML文件(.htm,.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。

Web开发的Java技术栈:了解Java EE、Servlet、JSP、Spring等常用于Web开发的技术Web开发的Java技术栈:了解Java EE、Servlet、JSP、Spring等常用于Web开发的技术Dec 26, 2023 pm 02:29 PM

JavaWeb开发技术栈:掌握JavaEE、Servlet、JSP、Spring等用于Web开发的技术随着互联网的迅速发展,在当今的软件开发领域,Web应用的开发已经成为一种非常重要的技术需求。而Java作为一种广泛应用的编程语言,其在Web开发领域也有着重要的地位。JavaWeb开发技术栈涉及多项技术,如JavaEE、Servlet、JSP、Spr

jsp中iframe是什么jsp中iframe是什么Aug 24, 2023 pm 04:02 PM

jsp中iframe是一种用于嵌入其他网页或文档的HTML标签,可以实现页面的分割、动态加载、异步加载和跨域访问等功能。它为开发人员提供了更多的灵活性和交互性,可以提高网页的可用性和用户体验。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!