不重装,不使用片段更改浏览器的URL和页面内容 [英] Change browser URL and page content without reload and without using fragments

查看:107
本文介绍了不重装,不使用片段更改浏览器的URL和页面内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很清楚使用URL片段来跟踪状态的一个AJAX供电网页的技术,但最近我发现了很多的都在做类似的事情的网站,但没有片段。

I'm well aware of the technique of using URL fragments to track state on an AJAX powered webpage, but lately I've noticed a lot of sites that are doing something similar but without fragments.

在脸谱例如最新版本的图片浏览器运行这种方式。左边和右边的导航按钮都没有,当没有做一个完整的页面加载点击改变浏览器的URL片段简单链接。

The picture viewer in the latest version of Facebook for example operates this way. The left and right navigation buttons are simple links with no fragments that when clicked change the browsers URL without doing a full page load.

另一个例子是GitHub的库浏览器,每个文件/文件夹的是改变了页面的状态和浏览器的URL无需重新装载或使用页面片段简单的链接。

Another example is GitHub's repository browser, each of the files/folders is a simple link that changes the page state and browser URL without reloading or using page fragments.

任何人都可以解释,或点我是如何工作的解释?我做了一些搜索,但没有使用,我一直无法片段发现过这么多的内容。

Can anyone explain, or point me to an explanation of how this works? I've done some searching, but there is so much content on using fragments that I haven't been able to find anything.

推荐答案

我相信这是由于的新的历史pushState的HTML5功能

这篇关于不重装,不使用片段更改浏览器的URL和页面内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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