用jquery做个页面验证时,提示jquery-1.4.4.min.js的138行错误是神马情况??

谁的大王 2012-08-08 05:59:27
我的代码:

jsp:
<%@ page language="java" contentType="text/html" pageEncoding="gbk"
errorPage=""%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>权限验证</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
</head>
<!-- serializeArray()用来序列化表单元素,返回json数组 -->
<body>
<s:form id="loginForm">
<s:textfield name="user" label="用户名" />
<s:textfield name="pass" label="密 码" />
<tr>
<td colspan="2">
<input id="loginBn" type="button" value="提交" />
</td>
</tr>
</s:form>
<div id="show" style="display: none;"></div>
<script type="text/javascript">
$.get("#loginBn").click(function(){
$.get(
"loginPro",
$("#loginForm").serializeArray(),
function(data,statusText){
$("#show").height(80).width(300)
.css("border","1px solid black")
.css("background-color","#efef99")
.css("color","#ff0000")
.css("padding","20px")
.empty();
$("#show").append("登陆结果:"+data+"<br/>");
$("#show").show(2000);
},
"html"
);
});
</script>
</body>
</html>

action:
public class loginAction extends ActionSupport {
private String user;
private String pass;
private InputStream inputStream;
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public InputStream getInputStream() {
return inputStream;
}
@Override
public String execute() throws Exception {
inputStream = user.equals("sprita1")&&pass.equals("sprita_1")
? new ByteArrayInputStream("恭喜你,登陆成功!".getBytes("utf-8"))
: new ByteArrayInputStream("对不起,用户名或密码不匹配!".getBytes("utf-8"));
return "success";
}
}

struts.xml:
<struts>
<package name="default" extends="struts-default">
<action name="loginPro" class="com.action.loginAction">
<result name="success" type="stream">
<param name="contentType">text/html</param>
<param name="inputName">inputStream</param>
</result>
<result name="login">/login.jsp</result>
</action>
</package>
</struts>
...全文
49 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧