您的位置:首页 > Web前端 > JQuery

(二)struts2- 2.3.15.3 spring3.2.4 mybatis-3.2.3 集成jquery-ui-1.10.3

2014-01-27 14:58 435 查看


Js库jquery-1.9.1.js,Ui jquery-ui-1.10.3

下载jquery-ui-1.10.3.zip包,后解压在,Test工程WebRoot下面建文件夹jquery,将themes、ui文件夹和jquery-1.9.1.js文件拷贝到jquery下面



在test.jsp页面中引入./jquery/jquery-1.9.1.js 并增加测试代码
<%@ page contentType="text/html; charset=UTF-8"%>
<html>
<head>
<title></title>
<script type="text/javascript" src="./jquery/jquery-1.9.1.js"></script>
<script type="text/javascript">
function insertTest() {
var myform = document.forms[0];
myform.action = "Test!save.action";
myform.method = "post";
myform.submit();
}
$(function() {
alert("hello jquery!!!");
});

</script>

</head>
<body>
<h1>样例</h1>
<hr>
<form name="myform">
id: <input type="text" name="test.id"> <br>
name: <input type="text" name="test.name"> <br>
<input type="button" name="btninsert" onclick="insertTest()" value="增加" />
</form>
</body>
</html>


部署到tomcat下访问http://localhost:8080/Test/test.jsp

弹出alert框“hello
jqeruy”集成成功!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: