ajax 怎么重新加载页面

$.ajax({
  type:"post",  url:url,  data:{xxx:xx},  dataType: "json",  
  success : function(data){   window.location.href="跳转的url,后边也可以拼接点data中数据作为参数";  }});
如果是需要跳转到另外的页面,也可以用window.open(url);
  success: function (data) {
            layer.msg(data["message"]);
            if (data["result"] == "success") {
                setTimeout(function () {
                    window.parent.location.reload();//让打开这个窗口的父窗口刷新,然后本子窗口关闭!
                }, 1000);
            }

猜你喜欢

转载自blog.csdn.net/a520songhai/article/details/80963000