jquery.form.js与后台交互在IE8和firefox出现不同状况

J2EE 码拜 9年前 (2015-04-08) 921次浏览 0个评论

前台JS
<script type=”text/javascript” src=”scripts/jquery-1.8.3.min.js”></script> 
<script type=”text/javascript” src=”scripts/jquery.form.js“></script>
<script type=”text/javascript”>
function okcc(){
 kc();
}
function kc(){                 
alert(“ee”);    
var options = {        
url : “wz/loginYongHu.action”,
type : “POST”,  
success : processJson,
error: eJson     
};
$(“#fdenglu”).ajaxSubmit(options);
return false;
}
function processJson(msg){
   if(msg==0){
   alert(“ttt”);
   }
}

function eJson(){
   alert(“ttaa”);
}
    
 </script> 

</head>

HTML
<form name=”denglu” id=”fdenglu” action=”wz/loginYongHu” method=”post”>
<div id=”rightcontent”>
<div id=”rightcontentn”>
<div id=”yonghulable”>
<span>登录名:</span>
</div>
<div id=”yonghuming”>
<input type=”text” name=”yonghuming” id=”yonghuming” />
</div>
<div id=”mimalable”>
<span id=”denglum”>登录密码:</span>
<span id=”wangjim”>忘记登录密码</span>
</div>
<div id=”mima”>
<input type=”text” name=”denglumima” id=”denglumima” />
</div>
<div id=”kongjian”>
</div>
<div id=”denglu”>
<a href=”#”><span id=”aaa” onclick=”okcc();return false;”>登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录</span></a>
</div>
<div id=”zhuce”>
<span>免费注册</span>
</div>

</div>
</div>
</form>

后台
public String loginYonghu() throws IOException{
     String dengLuMing=yonghuming.trim();
     String dengLuMiMa=mdPass.MD5Password(denglumima.trim());    
     String hql=”from Yonghu y where y.yonghuming=?0″;    
Yonghu yonghu=new Yonghu();
System.out.println(dengLuMing);
yonghu=yonghuManager.getYounhu(hql, dengLuMing);
System.out.println(yonghu);
if(yonghu==null){
tip=0;

}else{
if(dengLuMiMa.equals(yonghu.getYonghumima())){
tip=3;
}else{
tip=1;  
}
}
 PrintWriter out=null;
try{  
   HttpServletResponse response=ServletActionContext.getResponse();
   response.setCharacterEncoding(“utf-8”);
   response.setContentType(“text/html”);
response.setCharacterEncoding(“utf-8”);
out=response.getWriter();
out.print(tip);
out.flush(); 
out.close();
}catch(IOException e){
e.printStackTrace();
out.print(“上传失败,出错啦!”);
}

return SUCCESS;
    }

为什么在firefox就正常,在wi7 IE8就全乱了,例如先用firefox登录,再用IE登录,IE不管输入用户名和密码是什么都是按firefox登录过的用户名登录,如果先用IE登录就没到后台,但返回了些代码。请高高手说说


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明jquery.form.js与后台交互在IE8和firefox出现不同状况
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!