在jsp1页面中设置了一个条件查询按钮,通过点击按钮来触发AJAX传值给action,把查询结果存在list中,

在jsp1页面中设置了一个条件查询按钮,通过点击按钮来触发AJAX传值给action,把查询结果存在list中,action返回值return SUCCESS;,在struct2.xml中<result>/jsp/con_query.jsp</result>
。现在的问题是:点击JSP1页面的按钮后为什么没有跳转到con_query.jsp???我要的效果是,在新页面打开con_query.jsp。
解决问题:给20分。避免没人解决浪费分

return success后 应该在ajax中跳转页面
function editRole(id){
var obj = new Object();
obj.id = id;
$.ajax( {
type : 'POST',
url : getRootPath() + "/user/checkUsedRole",
data : $.toJSON(obj),
dataType : 'json',
contentType : 'application/json',
success : function(result) {
var items = result.list;
var info = "" ;
for (var i = 0; i < items.length; i++) {
info = info + items[i].message;
$.dialog.confirm('该角色已被使用,确定编辑?', function(){
window.location.href=getRootPath() + "/user/initEditRole/"+id;
})
}
},
error:function(jqXHR, textStatus, errorThrown){
alert("error");
}
});
}追问

可以打开新的页面吗(不要覆盖原页面)

追答

可以啊,window.open

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答