直接在submit 提交事件 success:function(){}裏面加window.location.href='xxxx'
火狐正常跳轉,ie報了一個語法錯誤。
整理了一下思路 換了個寫法:
from1.getForm().submit({
failure : function(myfrom, myaction) {
Ext.MessageBox.wait('請等待', '數據讀取中……');
if (myaction.result && myaction.result == 1) {
window.location.href = 'index.php?s=/index/index/main';
} else {
Ext.Msg.alert('用戶名密碼錯誤!請重新輸入!');
}
}
}
根據後臺返回的myaction.result值來判斷,因爲數據提交後,後臺返回的http狀態都是200,瀏覽器端就只解析爲true。這樣就後臺的返回值來判斷。