URL 中#号,? ,&的作用 (摘抄整理 链接为学习地址)

1. 一峰的网络日志:http://www.ruanyifeng.com/blog/2011/03/url_hash.html

   get: 1.页面滚动到指定页面的指定位置 (eg: http://www.example.com/index.html#print   <div id="print" >  index.html页面的Print位置  )

          2.#是用来指导浏览器动作的,对服务器端完全无用

   3.改变#不触发网页重载

   4.window.location.hash读取#值

   5.onhashchange事件 这是一个HTML 5新增的事件,当#值发生变化时,就会触发这个事件

  window.onhashchange = func;

  <body onhashchange="func();">

  window.addEventListener("hashchange", func, false);

      对于不支持onhashchange的浏览器,可以用setInterval监控location.hash的变化

    6.Google抓取#的机制

  默认情况下,Google的网络蜘蛛忽视URL的#部分。

  但是,Google还规定,如果你希望Ajax生成的内容被浏览引擎读取,那么URL中可以使用"#!",Google会自动将其后面的内容转成查询字符串_escaped_fragment_的值。

  比如,Google发现新版twitter的URL如下:

  http://twitter.com/#!/username

  就会自动抓取另一个URL:

  http://twitter.com/?_escaped_fragment_=/username

  通过这种机制,Google就可以索引动态的Ajax内容。

jihite:http://www.cnblogs.com/kaituorensheng/p/3776527.html

2. ?

1)连接作用:比如

http://www.xxx.com/Show.asp?id=77&nameid=2905210001&page=1

2)清除缓存:比如

http://www.xxxxx.com/index.html 
http://www.xxxxx.com/index.html?test123123

两个url打开的页面一样,但是后面这个有问号,说明不调用缓存的内容,而认为是一个新地址,重新读取

3. &

不同参数的间隔符

  

原文地址:https://www.cnblogs.com/Spring-Rain/p/5536758.html