改变窗口位置的Jquery [英] Change window location Jquery

查看:146
本文介绍了改变窗口位置的Jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AJAX来加载我的网站内容,并希望更新窗口位置时,Ajax是成功的。

I am using ajax to load my website content and want to update the window location when ajax is successful.

我如何更新窗口位置/ NEWPAGE?我需要用户能够回去刷新。这可能吗?

How can I update the window location to "/newpage"?? I need users to be able to go back and to refresh. Is this possible??

推荐答案

我在你使用jQuery做AJAX调用,所以你可以做到这一点pretty的很容易通过将重定向的成功,像这样假设

I'm assuming you're using jquery to make the AJAX call so you can do this pretty easily by putting the redirect in the success like so:

    $.ajax({
       url: 'ajax_location.html',
       success: function(data) {
          //this is the redirect
          document.location.href='/newpage/';
       }
    });

这篇关于改变窗口位置的Jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆