var url = "";
//提交
var urls = "${pageContext.request.contextPath}/action.dhtml";
$.ajax({
url: urls,//要提交的url
type:'post',//提交方式
async:false,//是否异步
//data:$('#form1').serialize(),//要提交的参数
success: function(msg){
if(msg == "true"){ //返回的结果比较
url="${pageContext.request.contextPath}/a/a.index";
}
}
});
if(url != "")
{
window.location = url;
}
转载于:https://my.oschina.net/farces/blog/272300