ext跳转页面

来源:百度知道 编辑:UC知道 时间:2024/06/06 13:22:36
success:function(form,action){
if (action.result.msg=='ok') {
document.location.href="View/DBtable/succ.jsp";
} else {
Ext.Msg.alert('添加错误',action.result.msg);
}
}

我点击按钮添加后 为什么不能跳转到我指定的页面呢?

首先一个跳转问题就是你跳转代码错了
document.location.href="View/DBtable/succ.jsp";
不对 应该是window.location.href="View/DBtable/succ.jsp";
然后前面的代码不知道你调过没有 就是要保证 你的请求返回值是成功 才能进入你success代码段,这里需要你return json里面有 success变量 为true
然后就是判断的变量 msg 你return json里面必须要有这个变量 msg且它的值为ok 才能触发你的跳转的代码