jsp里面怎么写Javascript

jsp里面怎么写Javascript,第1张

jsp里面怎么写Javascript

方法:1、直接在“<script></script>”标签对中写JavaScript代码;2、将JavaScript代码写在js文件中,使用“<script src="js文件路径" ></script>”语句将js文件导入jsp页面。

本教程 *** 作环境:windows7系统、javascript1.8.5版、Dell G3电脑。

在JSP页面中写JavaScript 脚本有两个方法:

1、直接在<script></script>标签中写JavaScript代码

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

2、写在js文件中,然后在页面中通过<script>标签的src属性引入

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

更多编程相关知识,请访问:编程入门!!

以上就是jsp里面怎么写Javascript的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/691805.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-21
下一篇 2022-04-21

发表评论

登录后才能评论

评论列表(0条)

保存