window.location的强制更新? [英] window.location force to update?

查看:142
本文介绍了window.location的强制更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道有没有办法为动力 window.location的更新?我是一个网页,其中使用Ajax生成的结果上。然而,网址保持在酒吧一样,所以我不能抢真实的URL。我不知道。我怎么会抢的网址是什么?我可以强制 window.location的无需刷新页面更新?

I'm wondering is there a way for force window.location to update? I'm on a page which uses ajax to generate results. However, the URL stays the same in the bar and so I can't grab the real URL. I'm wondering.. how would I grab the URL? can I force window.location to update without refreshing the page?

页我谈论的排序的一个例子是谷歌即时!

An example of the sort of page I'm talking about is google instant!

推荐答案

没有你不行。如果不控制页面,他们没有更新的方式的URL,那么有没有什么可以做。

No you can't. If you don't control the page and they are not updating the URL in a way, then there is nothing you can do.

但如果你有控制的,那么它是你的责任,要么使用片段标识符或HTML5的新的历史API来更新联系地址。 但是的,即使你使用历史API, window.location的不会得到改变。

But if you have control, then it is your responsibility to either use the fragment identifier or HTML5's new history API to update the adress. But even if you use the history API, window.location won't get changed.

更新:

不是100%肯定是谷歌即时页面,你在说什么,但如果是正常的谷歌页面,然后你会看到一个1或2秒后的URL更新后,您键入的查询。

Not 100% sure what Google Instant page you are talking about, but if it is the "normal" Google page, then you will see that the URL updates after 1 or 2 seconds after you typed the query.

所以,你可以为 hashchange 事件,然后抓住从网址 window.location的

这篇关于window.location的强制更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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