0 0

easyui form 提交问题,纠结了很久,有点诡异10

form 提交,后台运行有时慢,页面就不等后台数据的响应,直接alert("服务器维护中,请稍后再试!");
后来我发现,如果在action打断点,前台jsp直接会进入alert,根本就不会等待后台的响应。这是什么原因?  

$('#DzMediumRegister').form('submit', {
url : 'registerAction!register.action',
onSubmit : function(param) {
param.regType = mediunRegType;
param.wtms = $('#e_safeQuestions').combobox('getText');
if(mediunRegType =="12"){//邮箱注册
_email = $("#vv").val();
}
if(mediunRegType =="11"){
_mobile = $("#zjmobile").val();
}
//return true;
return $(this).form('validate');//对数据进行格式化
},
success : function(data) {
if(jQuery.isEmptyObject(data)){
alert("服务器维护中,请稍后再试!");
}
var obj = jQuery.parseJSON(data);
if (obj.Success) {
if(mediunRegType =="12"){//邮箱注册
location.href = "<%=basePath%>jquery-easyui-1.4/demo/register2.jsp?yhbm="+obj.yhbm+"&email="+obj.email;
}else if(mediunRegType =="11"){
location.href = "<%=basePath%>jquery-easyui-1.4/demo/register2.jsp?yhbm="+obj.yhbm+"&mobile="+obj.mobile;
}


}
});

问题补充:alert("服务器维护中,请稍后再试!") 的时候,后台正进入断点中,很明显未返回响应,但是easyui是怎么得到成功响应进入回调函数的

问题补充:发现了问题,IE下正常,360浏览器下报
Error in response to storage.get: TypeError: Cannot read property 'shoptemplate' of undefined
    at Object.tpl.loadPageTplData (chrome-extension://dobbgecnokkloebjbcnjpgcopegjabpa/js/box.js:1:8515)
    at Object.tpl.getPageTplData (chrome-extension://dobbgecnokkloebjbcnjpgcopegjabpa/js/box.js:1:6017)
    at chrome-extension://dobbgecnokkloebjbcnjpgcopegjabpa/js/box.js:1:11664
    at Object.callback (chrome-extension://dobbgecnokkloebjbcnjpgcopegjabpa/js/box.js:1:1232) extensions::sendRequest:26
safeCallbackApply extensions::sendRequest:26
handleResponse
2014年12月31日 16:22

1个答案 按时间排序 按投票排序

0 0

好像$('#DzMediumRegister').form('submit', 是通过动态创建一个iframe,然后在里面创建一个表单post的方式来实现ajax效果, 不是用xmlHttpRequest, 会不会问题就是出现不同浏览器对这种方式的支持不同导致的?

2015年1月05日 11:29

相关推荐

Global site tag (gtag.js) - Google Analytics