Possible Duplicate: Modify the URL without reloading the page I know the subject is a little bit odd. When I go to http://www.heroku.com/how/relax and click other menus (Deploy, Connect, and...so on), I see that the browser changes its url, but it feels like Ajax. What is this technique called? This technique is called using javascript & DOM to change the content of the page with fa
可能重复: 修改网址而不重新加载页面 我知道这个话题有点奇怪。 当我访问http://www.heroku.com/how/relax并点击其他菜单(Deploy,Connect等...)时,我发现浏览器改变了它的url,但感觉就像Ajax。 这种技术叫做什么? 这种技术被称为使用javascript和DOM来改变fadeIn()和[fadeOut()] [2]动画(用于jQuery)页面的内容。 对于页面位置更改: 您必须使用HTML5的pushState()方法来更改浏览器历史记录。 wind
This question already has an answer here: Modify the URL without reloading the page 18 answers You can in newer browsers; in older ones, you can only change the hash. This seems like a good article on the topic: http://html5doctor.com/history-api/ What you are looking for is the History API HTML5 provides. It comes with functionality like history.pushState(...) , history.popState(...) ,
这个问题在这里已经有了答案: 修改网址而不重新加载页面18个答案 你可以在较新的浏览器中使用; 在旧版本中,只能更改散列。 这似乎是一个关于这个主题的好文章:http://html5doctor.com/history-api/ 您正在寻找的是HTML5提供的History API。 它带有像history.pushState(...) , history.popState(...) ,它可以让您动态更改URL,而无需完全分配新的URL。 它被许多网站使用,包括我猜想,Facebook本身,如果你打开一
Possible Duplicate: Modify the URL without reloading the page I'm looking for a way to make my internal links functional using my current javascript animations, without causing the page to reload when you click on them - but I would like the URL to update in the browser . Many websites do this, here is a good example: http://grooveshark.com/#!/search?q=adf How do they get the URL to u
可能重复: 修改网址而不重新加载页面 我正在寻找一种方法,使我的内部链接功能使用我当前的JavaScript动画,而不会导致页面重新加载,当你点击它们 - 但我希望URL在浏览器中更新 。 许多网站都是这样做的,下面是一个很好的例子:http://grooveshark.com/#!/search?q=adf 他们如何在没有页面重新加载的情况下获得URL更新? 更多细节: 目前,我的网页上的链接看起来像<a href="#aboutus">About Us&
This question already has an answer here: Modify the URL without reloading the page 18 answers 使用pushState : window.history.pushState("", "", '/newpage'); If you want to know exactly what they using, it's Backbone.js (see lines 4574 and 4981 ). It's all mixed up in there with the jQuery source, but these are the relevant lines of the annotated Backbone.Router source documentation
这个问题在这里已经有了答案: 修改网址而不重新加载页面18个答案 使用pushState : window.history.pushState("", "", '/newpage'); 如果你想知道他们使用的是什么,那就是Backbone.js (见4574和4981 )。 它们都与jQuery源代码混合在一起,但是这些是注释的Backbone.Router源文档页面的相关行: 支持检查: this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState &am
I seem to remember reading that modern browsers try to stop the hiding of the address bar of a popup window, but there were ways around this.. Currently I'm using this code : <script language="javascript"> var popupWindow = null; function centeredPopup(url,winName,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height
我似乎记得现在的浏览器试图阻止隐藏弹出窗口的地址栏,但有办法解决这个问题.. 目前我正在使用此代码: <script language="javascript"> var popupWindow = null; function centeredPopup(url,winName,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+T
If I go to a sub-path of a domain, the normal way is to do <a href="/somepath">Some Path</a> . This will reload the page completely. But on Facebook, when you open a photo, the url on the address bar changes, however the entire page doesn't reload, it only loads the photo platform. So in this way people can share url of photos. I'm wondering how is this done?
如果我转到域的子路径,通常的方法是执行<a href="/somepath">Some Path</a> 。 这将完全重新加载页面。 但在Facebook上,当您打开照片时,地址栏上的网址会发生变化,但整个页面不会重新加载,只会加载照片平台。 所以用这种方式人们可以分享照片的网址。 我想知道这是如何完成的? 我做了一些搜索,有人建议使用history.pushState ,但是,这只适用于大多数现代浏览器。 Facebook上的那个也适用
Sometimes when I'm debugging some javascript in Chrome and I have the javascript paused, if I try to reload the page, chrome instead just "continues" the debugger, stepping to next breakpoint. There doesn't seem to be any way to force the javascript to stop running completely, and let chrome just reload the page. Every press of -R or click of the reload button simply continue
有时当我在Chrome中调试一些javascript时,如果我尝试重新加载页面,我暂停了javascript,但是chrome只是“继续”调试器,跳到下一个断点。 似乎没有任何方法可以强制javascript停止完全运行,并让chrome重新加载页面。 每按一次-R或单击重新加载按钮,都会继续到下一个断点。 我现在的转移解决方案是 复制网址栏地址 关闭该标签 打开一个新标签 然后在新标签中打开网址。 这是非常暴力的,但它是我让Chrome实际加
Which one of these is the most effective vs checking if the user agent is accessing via the correct domain. We would like to show a small js based 'top bar' style warning if they are accessing the domain using some sort of web proxy (as it tends to break the js). We were thinking about using the following: var r = /.*domain.com$/; if (r.test(location.hostname)) { // showMessage .
其中哪一个是最有效的,与检查用户代理是否通过正确的域进行访问有关。 如果他们使用某种网络代理访问域(因为它倾向于打破js),我们希望显示一个基于js的小型'顶部栏'样式警告。 我们正在考虑使用以下内容: var r = /.*domain.com$/; if (r.test(location.hostname)) { // showMessage ... } 这将涉及我们曾经使用过的任何子域名。 我们应该使用主机还是主机名? 在Firefox 5和Chrome 12中: console.l
How would I have a JavaScript action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark the new URL is used? It would also be nice if the back button would reload the original URL. I am trying to record JavaScript state in the URL. If you want it to work in browsers that don't support history.pushState and h
我如何获得可能对当前页面有一定影响的JavaScript操作,但是也会更改浏览器中的URL,因此如果用户点击重新加载或书签,则会使用新的URL? 如果后退按钮将重新加载原始URL,这也会很好。 我正在尝试在URL中记录JavaScript状态。 如果您希望它在不支持history.pushState和history.popState浏览器中工作,“旧”方法是设置片段标识符,这不会导致页面重新加载。 基本思想是将window.location.hash属性设置为包含所需状态信息
On a webpage that has a list of categories, and each category title is linked in this format: http://localhost/admin/category/unpublish/2 I wrote the following js code, trying to capture the url and the segments 'unpublish' (action) and '2' (id), and need to send the request to http://localhost/admin/category $('#statusChanges a').click(function(evt) { // use the click event of
在包含类别列表的网页上,每个类别标题以此格式链接: http://localhost/admin/category/unpublish/2 我写了下面的js代码,试图捕获url和段的'unpublish'(action)和'2'(id),并且需要将请求发送到http://localhost/admin/category $('#statusChanges a').click(function(evt) { // use the click event of hyperlinks evt.preventDefault(); var url = $(location).attr('href'); // var action = u