码迷,mamicode.com
首页 > Web开发 > 详细

从QQ密码修改的小问题回顾下URL Fragment

时间:2018-04-05 14:27:22      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:历史   关于   密码修改   变化   网页   html   fragment   ash   code   

改变#不会导致页面重新加载,但是会改变浏览器历史记录

关于这点很容易测试,假设当前访问的页面是http://www.qq.com,打开控制台,分别输入如下命令看下区别(是否刷新),然后,再查看window.history有什么区别(历史记录是否变化)

location.href += ‘#caper‘;  //页面不会刷新
location.href += ‘?visitor=caper‘;  //页面刷新

在普通的网页浏览中,我们每点击一个网页链接,就会在浏览器历史记录中新增一条浏览记录,并通过浏览器的导航功能轻松进行‘上一步‘、‘下一步‘的操作。

但对于ajax应用,url通常是不会变化的,尤其是单页面应用。这也就意味着,用户习以为常的浏览器导航功能(上一步、下一步)失去了作用,这在体验上是比较糟糕的。通过#,开发者可以利用不同的id,标识当前页面所处状态,提升用户体验。

 

5、JS中可以通过window.location.hash来读取或改变#的值

没什么好讲的,可结上一点简单测试下 :)

 

6、谷歌的网络蜘蛛默认会忽略#后面的内容

谷歌网络蜘蛛负责爬取网页的内容,以及网页里面的链接,它们会成为google搜索索引的一部分。网络蜘蛛会抓取并分析HTML,但由于它并不是浏览器程序,也没有javascript引擎,页面上用来加载显示内容的javascript并不会被执行。因此,#后面的字符会被网络蜘蛛忽视,只抓取#前面的内容,举例:

链接一:http://www.cnblogs.com/#casper
链接二:http://www.cnblogs.com/#chyingp

对于网络蜘蛛来说,链接一、链接二其实是一样的,它只会抓取http://www.cnblogs.com的内容,尽管两个链接可能展示的是不同的内容

这点无论对于开发者,还是搜索引擎都是不利的,前者辛苦创作的内容(应用)少了很多被访问的机会,而后者则失去了进一步丰富其内容索引的机会,特别是在ajax应用越来越多的今天。

为了解决这个问题,google提供了一个解决方案:hash bang,只要将#改成#!即可,实现大致为:当网络蜘蛛遇到#!时候,会自动将#!identifier转成_escaped_fragment_=identifier形式的参数,修改下之前的链接

 

http://tieba.baidu.com/p/5632998173
http://tieba.baidu.com/p/5634106628
http://www.cnblogs.com/taobao1/p/8722203.html
http://www.cnblogs.com/taobao1/p/8722145.html
https://www.cnblogs.com/baidu1/p/8722089.html
https://www.cnblogs.com/baidu1/p/8722086.html
https://www.cnblogs.com/baidu1/p/8722083.html
https://www.cnblogs.com/baidu1/p/8722078.html
https://www.cnblogs.com/baidu1/p/8722077.html
https://www.cnblogs.com/baidu1/p/8722073.html
https://www.cnblogs.com/baidu1/p/8722071.html
https://www.cnblogs.com/baidu1/p/8722070.html
https://www.cnblogs.com/baidu1/p/8722064.html
https://www.cnblogs.com/baidu1/p/8722059.html
https://www.cnblogs.com/baidu1/p/8722056.html
https://www.cnblogs.com/baidu1/p/8722046.html
https://www.cnblogs.com/baidu1/p/8722039.html
https://www.cnblogs.com/baidu1/p/8722035.html
https://www.cnblogs.com/baidu1/p/8722026.html
https://www.cnblogs.com/baidu1/p/8722022.html
https://www.cnblogs.com/baidu1/p/8722019.html
https://www.cnblogs.com/baidu1/p/8722017.html
https://www.cnblogs.com/baidu1/p/8722015.html
https://www.cnblogs.com/baidu1/p/8722009.html
https://www.cnblogs.com/baidu1/p/8722007.html
https://www.cnblogs.com/baidu1/p/8722001.html
https://www.cnblogs.com/baidu1/p/8721997.html
https://www.cnblogs.com/baidu1/p/8721988.html
https://www.cnblogs.com/baidu1/p/8721984.html
https://www.cnblogs.com/baidu1/p/8721976.html
https://www.cnblogs.com/baidu1/p/8721973.html
https://www.cnblogs.com/baidu1/p/8721967.html
https://www.cnblogs.com/baidu1/p/8721962.html
https://www.cnblogs.com/baidu1/p/8721959.html
https://www.cnblogs.com/baidu1/p/8721950.html
https://www.cnblogs.com/baidu1/p/8721946.html
https://www.cnblogs.com/baidu1/p/8721941.html
https://www.cnblogs.com/baidu1/p/8721939.html
https://www.cnblogs.com/baidu1/p/8721934.html
https://www.cnblogs.com/baidu1/p/8721929.html
https://www.cnblogs.com/baidu1/p/8721919.html
https://www.cnblogs.com/baidu1/p/8721915.html
https://www.cnblogs.com/baidu1/p/8721911.html
https://www.cnblogs.com/baidu1/p/8721909.html
https://www.cnblogs.com/baidu1/p/8721905.html
https://www.cnblogs.com/baidu1/p/8721901.html
https://www.cnblogs.com/baidu1/p/8721894.html
https://www.cnblogs.com/baidu1/p/8721886.html
https://www.cnblogs.com/baidu1/p/8721885.html
https://www.cnblogs.com/baidu1/p/8721875.html
https://www.cnblogs.com/baidu1/p/8721873.html
https://www.cnblogs.com/baidu1/p/8721861.html
https://www.cnblogs.com/baidu1/p/8721856.html
https://www.cnblogs.com/baidu1/p/8721847.html
https://www.cnblogs.com/baidu1/p/8721843.html
https://www.cnblogs.com/baidu1/p/8721833.html
https://www.cnblogs.com/baidu1/p/8721825.html
https://www.cnblogs.com/baidu1/p/8721817.html
https://www.cnblogs.com/baidu1/p/8721809.html
https://www.cnblogs.com/baidu1/p/8721803.html
https://www.cnblogs.com/baidu1/p/8721801.html
https://www.cnblogs.com/baidu1/p/8721795.html
https://www.cnblogs.com/baidu1/p/8721792.html
https://www.cnblogs.com/baidu1/p/8721785.html
https://www.cnblogs.com/baidu1/p/8721782.html
https://www.cnblogs.com/baidu1/p/8721771.html
https://www.cnblogs.com/baidu1/p/8721766.html
https://www.cnblogs.com/baidu1/p/8721759.html
https://www.cnblogs.com/baidu1/p/8721755.html
https://www.cnblogs.com/baidu1/p/8721743.html
https://www.cnblogs.com/baidu1/p/8721737.html
https://www.cnblogs.com/baidu1/p/8721731.html
https://www.cnblogs.com/baidu1/p/8721728.html
https://www.cnblogs.com/baidu1/p/8721719.html
https://www.cnblogs.com/baidu1/p/8721713.html
https://www.cnblogs.com/baidu1/p/8721705.html
https://www.cnblogs.com/baidu1/p/8721700.html
https://www.cnblogs.com/baidu1/p/8721696.html
https://www.cnblogs.com/baidu1/p/8721695.html
https://www.cnblogs.com/baidu1/p/8721688.html
https://www.cnblogs.com/baidu1/p/8721686.html
https://www.cnblogs.com/baidu1/p/8721683.html
https://www.cnblogs.com/baidu1/p/8721679.html
https://www.cnblogs.com/baidu1/p/8721674.html
https://www.cnblogs.com/baidu1/p/8721667.html
https://www.cnblogs.com/baidu1/p/8721657.html
https://www.cnblogs.com/baidu1/p/8721653.html
https://www.cnblogs.com/baidu1/p/8721649.html
https://www.cnblogs.com/baidu1/p/8721644.html
https://www.cnblogs.com/baidu1/p/8721639.html
https://www.cnblogs.com/baidu1/p/8721628.html
https://www.cnblogs.com/baidu1/p/8721624.html
https://www.cnblogs.com/baidu1/p/8721622.html
https://www.cnblogs.com/baidu1/p/8721619.html
https://www.cnblogs.com/baidu1/p/8721611.html
https://www.cnblogs.com/baidu1/p/8721604.html
https://www.cnblogs.com/baidu1/p/8721601.html
https://www.cnblogs.com/baidu1/p/8721594.html
https://www.cnblogs.com/baidu1/p/8721592.html
https://www.cnblogs.com/baidu1/p/8721584.html
https://www.cnblogs.com/baidu1/p/8721580.html
https://www.cnblogs.com/baidu1/p/8721578.html
https://www.cnblogs.com/baidu1/p/8721574.html
https://www.cnblogs.com/baidu1/p/8721567.html
https://www.cnblogs.com/baidu1/p/8721564.html
http://www.cnblogs.com/baidu1/p/8722089.html
http://www.cnblogs.com/baidu1/p/8722086.html
http://www.cnblogs.com/baidu1/p/8722083.html
http://www.cnblogs.com/baidu1/p/8722078.html
http://www.cnblogs.com/baidu1/p/8722077.html
http://www.cnblogs.com/baidu1/p/8722073.html
http://www.cnblogs.com/baidu1/p/8722071.html
http://www.cnblogs.com/baidu1/p/8722070.html
http://www.cnblogs.com/baidu1/p/8722064.html
http://www.cnblogs.com/baidu1/p/8722059.html
http://www.cnblogs.com/baidu1/p/8722056.html
http://www.cnblogs.com/baidu1/p/8722046.html
http://www.cnblogs.com/baidu1/p/8722039.html
http://www.cnblogs.com/baidu1/p/8722035.html
http://www.cnblogs.com/baidu1/p/8722026.html
http://www.cnblogs.com/baidu1/p/8722022.html
http://www.cnblogs.com/baidu1/p/8722019.html
http://www.cnblogs.com/baidu1/p/8722017.html
http://www.cnblogs.com/baidu1/p/8722015.html
http://www.cnblogs.com/baidu1/p/8722009.html
http://www.cnblogs.com/baidu1/p/8722007.html
http://www.cnblogs.com/baidu1/p/8722001.html
http://www.cnblogs.com/baidu1/p/8721997.html
http://www.cnblogs.com/baidu1/p/8721988.html
http://www.cnblogs.com/baidu1/p/8721984.html
http://www.cnblogs.com/baidu1/p/8721976.html
http://www.cnblogs.com/baidu1/p/8721973.html
http://www.cnblogs.com/baidu1/p/8721967.html
http://www.cnblogs.com/baidu1/p/8721962.html
http://www.cnblogs.com/baidu1/p/8721959.html
http://www.cnblogs.com/baidu1/p/8721950.html
http://www.cnblogs.com/baidu1/p/8721946.html
http://www.cnblogs.com/baidu1/p/8721941.html
http://www.cnblogs.com/baidu1/p/8721939.html
http://www.cnblogs.com/baidu1/p/8721934.html
http://www.cnblogs.com/baidu1/p/8721929.html
http://www.cnblogs.com/baidu1/p/8721919.html
http://www.cnblogs.com/baidu1/p/8721915.html
http://www.cnblogs.com/baidu1/p/8721911.html
http://www.cnblogs.com/baidu1/p/8721909.html
http://www.cnblogs.com/baidu1/p/8721905.html
http://www.cnblogs.com/baidu1/p/8721901.html
http://www.cnblogs.com/baidu1/p/8721894.html
http://www.cnblogs.com/baidu1/p/8721886.html
http://www.cnblogs.com/baidu1/p/8721885.html
http://www.cnblogs.com/baidu1/p/8721875.html
http://www.cnblogs.com/baidu1/p/8721873.html
http://www.cnblogs.com/baidu1/p/8721861.html
http://www.cnblogs.com/baidu1/p/8721856.html
http://www.cnblogs.com/baidu1/p/8721847.html
http://www.cnblogs.com/baidu1/p/8721843.html
http://www.cnblogs.com/baidu1/p/8721833.html
http://www.cnblogs.com/baidu1/p/8721825.html
http://www.cnblogs.com/baidu1/p/8721817.html
http://www.cnblogs.com/baidu1/p/8721809.html
http://www.cnblogs.com/baidu1/p/8721803.html
http://www.cnblogs.com/baidu1/p/8721801.html
http://www.cnblogs.com/baidu1/p/8721795.html
http://www.cnblogs.com/baidu1/p/8721792.html
http://www.cnblogs.com/baidu1/p/8721785.html
http://www.cnblogs.com/baidu1/p/8721782.html
http://www.cnblogs.com/baidu1/p/8721771.html
http://www.cnblogs.com/baidu1/p/8721766.html
http://www.cnblogs.com/baidu1/p/8721759.html
http://www.cnblogs.com/baidu1/p/8721755.html
http://www.cnblogs.com/baidu1/p/8721743.html
http://www.cnblogs.com/baidu1/p/8721737.html
http://www.cnblogs.com/baidu1/p/8721731.html
http://www.cnblogs.com/baidu1/p/8721728.html
http://www.cnblogs.com/baidu1/p/8721719.html
http://www.cnblogs.com/baidu1/p/8721713.html
http://www.cnblogs.com/baidu1/p/8721705.html
http://www.cnblogs.com/baidu1/p/8721700.html
http://www.cnblogs.com/baidu1/p/8721696.html
http://www.cnblogs.com/baidu1/p/8721695.html
http://www.cnblogs.com/baidu1/p/8721688.html
http://www.cnblogs.com/baidu1/p/8721686.html
http://www.cnblogs.com/baidu1/p/8721683.html
http://www.cnblogs.com/baidu1/p/8721679.html
http://www.cnblogs.com/baidu1/p/8721674.html
http://www.cnblogs.com/baidu1/p/8721667.html
http://www.cnblogs.com/baidu1/p/8721657.html
http://www.cnblogs.com/baidu1/p/8721653.html
http://www.cnblogs.com/baidu1/p/8721649.html
http://www.cnblogs.com/baidu1/p/8721644.html
http://www.cnblogs.com/baidu1/p/8721639.html
http://www.cnblogs.com/baidu1/p/8721628.html
http://www.cnblogs.com/baidu1/p/8721624.html
http://www.cnblogs.com/baidu1/p/8721622.html
http://www.cnblogs.com/baidu1/p/8721619.html
http://www.cnblogs.com/baidu1/p/8721611.html
http://www.cnblogs.com/baidu1/p/8721604.html
http://www.cnblogs.com/baidu1/p/8721601.html
http://www.cnblogs.com/baidu1/p/8721594.html
http://www.cnblogs.com/baidu1/p/8721592.html
http://www.cnblogs.com/baidu1/p/8721584.html
http://www.cnblogs.com/baidu1/p/8721580.html
http://www.cnblogs.com/baidu1/p/8721578.html
http://www.cnblogs.com/baidu1/p/8721574.html
http://www.cnblogs.com/baidu1/p/8721567.html
http://www.cnblogs.com/baidu1/p/8721564.html
www.cnblogs.com/baidu1/p/8722089.html
www.cnblogs.com/baidu1/p/8722086.html
www.cnblogs.com/baidu1/p/8722083.html
www.cnblogs.com/baidu1/p/8722078.html
www.cnblogs.com/baidu1/p/8722077.html
www.cnblogs.com/baidu1/p/8722073.html
www.cnblogs.com/baidu1/p/8722071.html
www.cnblogs.com/baidu1/p/8722070.html
www.cnblogs.com/baidu1/p/8722064.html
www.cnblogs.com/baidu1/p/8722059.html
www.cnblogs.com/baidu1/p/8722056.html
www.cnblogs.com/baidu1/p/8722046.html
www.cnblogs.com/baidu1/p/8722039.html
www.cnblogs.com/baidu1/p/8722035.html
www.cnblogs.com/baidu1/p/8722026.html
www.cnblogs.com/baidu1/p/8722022.html
www.cnblogs.com/baidu1/p/8722019.html
www.cnblogs.com/baidu1/p/8722017.html
www.cnblogs.com/baidu1/p/8722015.html
www.cnblogs.com/baidu1/p/8722009.html
www.cnblogs.com/baidu1/p/8722007.html
www.cnblogs.com/baidu1/p/8722001.html
www.cnblogs.com/baidu1/p/8721997.html
www.cnblogs.com/baidu1/p/8721988.html
www.cnblogs.com/baidu1/p/8721984.html
www.cnblogs.com/baidu1/p/8721976.html
www.cnblogs.com/baidu1/p/8721973.html
www.cnblogs.com/baidu1/p/8721967.html
www.cnblogs.com/baidu1/p/8721962.html
www.cnblogs.com/baidu1/p/8721959.html
www.cnblogs.com/baidu1/p/8721950.html
www.cnblogs.com/baidu1/p/8721946.html
www.cnblogs.com/baidu1/p/8721941.html
www.cnblogs.com/baidu1/p/8721939.html
www.cnblogs.com/baidu1/p/8721934.html
www.cnblogs.com/baidu1/p/8721929.html
www.cnblogs.com/baidu1/p/8721919.html
www.cnblogs.com/baidu1/p/8721915.html
www.cnblogs.com/baidu1/p/8721911.html
www.cnblogs.com/baidu1/p/8721909.html
www.cnblogs.com/baidu1/p/8721905.html
www.cnblogs.com/baidu1/p/8721901.html
www.cnblogs.com/baidu1/p/8721894.html
www.cnblogs.com/baidu1/p/8721886.html
www.cnblogs.com/baidu1/p/8721885.html
www.cnblogs.com/baidu1/p/8721875.html
www.cnblogs.com/baidu1/p/8721873.html
www.cnblogs.com/baidu1/p/8721861.html
www.cnblogs.com/baidu1/p/8721856.html
www.cnblogs.com/baidu1/p/8721847.html
www.cnblogs.com/baidu1/p/8721843.html
www.cnblogs.com/baidu1/p/8721833.html
www.cnblogs.com/baidu1/p/8721825.html
www.cnblogs.com/baidu1/p/8721817.html
www.cnblogs.com/baidu1/p/8721809.html
www.cnblogs.com/baidu1/p/8721803.html
www.cnblogs.com/baidu1/p/8721801.html
www.cnblogs.com/baidu1/p/8721795.html
www.cnblogs.com/baidu1/p/8721792.html
www.cnblogs.com/baidu1/p/8721785.html
www.cnblogs.com/baidu1/p/8721782.html
www.cnblogs.com/baidu1/p/8721771.html
www.cnblogs.com/baidu1/p/8721766.html
www.cnblogs.com/baidu1/p/8721759.html
www.cnblogs.com/baidu1/p/8721755.html
www.cnblogs.com/baidu1/p/8721743.html
www.cnblogs.com/baidu1/p/8721737.html
www.cnblogs.com/baidu1/p/8721731.html
www.cnblogs.com/baidu1/p/8721728.html
www.cnblogs.com/baidu1/p/8721719.html
www.cnblogs.com/baidu1/p/8721713.html
www.cnblogs.com/baidu1/p/8721705.html
www.cnblogs.com/baidu1/p/8721700.html
www.cnblogs.com/baidu1/p/8721696.html
www.cnblogs.com/baidu1/p/8721695.html
www.cnblogs.com/baidu1/p/8721688.html
www.cnblogs.com/baidu1/p/8721686.html
www.cnblogs.com/baidu1/p/8721683.html
www.cnblogs.com/baidu1/p/8721679.html
www.cnblogs.com/baidu1/p/8721674.html
www.cnblogs.com/baidu1/p/8721667.html
www.cnblogs.com/baidu1/p/8721657.html
www.cnblogs.com/baidu1/p/8721653.html
www.cnblogs.com/baidu1/p/8721649.html
www.cnblogs.com/baidu1/p/8721644.html
www.cnblogs.com/baidu1/p/8721639.html
www.cnblogs.com/baidu1/p/8721628.html
www.cnblogs.com/baidu1/p/8721624.html
www.cnblogs.com/baidu1/p/8721622.html
www.cnblogs.com/baidu1/p/8721619.html
www.cnblogs.com/baidu1/p/8721611.html
www.cnblogs.com/baidu1/p/8721604.html
www.cnblogs.com/baidu1/p/8721601.html
www.cnblogs.com/baidu1/p/8721594.html
www.cnblogs.com/baidu1/p/8721592.html
www.cnblogs.com/baidu1/p/8721584.html
www.cnblogs.com/baidu1/p/8721580.html
www.cnblogs.com/baidu1/p/8721578.html
www.cnblogs.com/baidu1/p/8721574.html
www.cnblogs.com/baidu1/p/8721567.html
www.cnblogs.com/baidu1/p/8721564.html

从QQ密码修改的小问题回顾下URL Fragment

标签:历史   关于   密码修改   变化   网页   html   fragment   ash   code   

原文地址:https://www.cnblogs.com/taobao1/p/8722238.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!