<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.8.2.js" charset="UTF-8"></script>
<script type="text/javascript">
var args = {};
function send(){
var v = $("form").find(":input,textarea").each(function(){
if (this.name != "" && this.type != "button") {
if ($(this).val() != "") {
args[this.name] = $.trim($(this).val());
}
}
});
console.info(args);
}
</script>
</head>
<body>
<form id="form1" action="">
<table>
<tr><td>用户名</td><td><input type="text" name="name"/></td></tr>
<tr><td>密码</td><td><input type="password" name="pwd"></td></tr>
</table>
</form>
<input type="button" value="提交" onclick="send()">
</body>
</html>
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.8.2.js" charset="UTF-8"></script>
<script type="text/javascript">
var args = {};
function send(){
var v = $("form").find(":input,textarea").each(function(){
if (this.name != "" && this.type != "button") {
if ($(this).val() != "") {
args[this.name] = $.trim($(this).val());
}
}
});
console.info(args);
}
</script>
</head>
<body>
<form id="form1" action="">
<table>
<tr><td>用户名</td><td><input type="text" name="name"/></td></tr>
<tr><td>密码</td><td><input type="password" name="pwd"></td></tr>
</table>
</form>
<input type="button" value="提交" onclick="send()">
</body>
</html>