当前位置:网站首页>""? "& in URL Role of "" sign
""? "& in URL Role of "" sign
2022-06-13 09:00:00 【xiongpursuit88】
Read the directory
- ?
- &
Back to the top 10 year 9 month ,twitter Revision . A significant change , Namely URL Joined the "#!“ Symbol . such as , The website of the user's home page before the revision is http://twitter.com/username The revised , It becomes http://twitter.com/#!/username
This is the first time a mainstream website will ”#" Large scale for important URL in . This shows that the well number (Hash) The role of is being re recognized . This article is based on HttpWatch The article , Sort out all important knowledge points related to well number .
One 、# Meaning of
# Represents a location in a web page . The character on the right side of it , Is the identifier of the location . such as ,http://www.example.com/index.html#print On behalf of the web page index.html Of print Location . The browser reads this URL after , Will automatically print Position scroll to viewable area .
Specify the identifier for the web location , There are two ways . One is the use of anchors , such as , The two is the use of id attribute , such as.
Two 、HTTP The request does not include #
# It's used to guide browser actions , Nothing to do with the server side . therefore ,HTTP The request does not include #.
such as , Visit the website below ,http://www.example.com/index.html#print, The actual request from the browser is like this :
GET /index.html HTTP/1.1
Host: www.example.com
3、 ... and 、# After the character
At the first # Any character that appears after , Will be interpreted by browsers as location identifiers . It means , None of these characters will be sent to the server .
such as , below URL The original meaning is to specify a color value :http://www.example.com/?color=#fff, however , The actual request from the browser is :
GET /?color= HTTP/1.1
Host: www.example.com
Four 、 change # Do not trigger page overloading
Just change # The latter part , The browser will only scroll to the appropriate location , The web page will not be reloaded .
such as , from http://www.example.com/index.html#location1 Change to http://www.example.com/index.html#location2, The browser will not re request from the server index.html.
5、 ... and 、 change # Will change the browser's access history
Every change # The latter part , Will add a record to the browser's access history , Use " back off " Button , You can go back to the previous position . This is for ajax Applications are particularly useful , You can use different # value , Indicates different access states , Then give the user a link to access a certain state . It is worth noting that , The above rules are applicable to IE 6 and IE 7 Don't set up , They don't because # Change to add history .
6、 ... and 、window.location.hash Read # value
window.location.hash This property is readable and writable . When reading , It can be used to determine whether the state of a web page has changed ; When writing , Without overloading the web page , Create a history of visits .
7、 ... and 、onhashchange event
This is a HTML 5 New events , When # When values change , Will trigger this event .IE8+、Firefox 3.6+、Chrome 5+、Safari 4.0+ Support the event .
It can be used in three ways :
window.onhashchange = func;
window.addEventListener("hashchange", func, false); For not supporting onhashchange Browser , It can be used setInterval monitor location.hash The change of . 8、 ... and 、Google Grab # The mechanism of
By default ,Google Web spiders ignore URL Of # part .
however ,Google It also stipulates that , If you wish Ajax The generated content is read by the browser engine , that URL Can be used in "#!",Google It will automatically convert the content after it into a query string _escaped_fragment_ Value .
such as ,Google Find a new version twitter Of URL:http://twitter.com/#!/username
It will automatically grab another URL:http://twitter.com/?escaped_fragment=/username
Through this mechanism ,Google You can index dynamic Ajax Content .
notes
AJAX = asynchronous JavaScript and XML( A subset of Standard General Markup Languages ).AJAX Is a technology for creating fast dynamic web pages .
Back to the top
2. ?
1) Connectedness : such as
http://www.xxx.com/Show.asp?id=77&nameid=2905210001&page=1
2) Clear cache : such as
http://www.xxxxx.com/index.html
http://www.xxxxx.com/index.html?test123123
Two url Open the same page , But there's a question mark on the back , Description does not call the contents of the cache , And think it's a new address , Reread .
Back to the top
3. &
Separators for different parameters
边栏推荐
- Visual studio tools using shortcut keys (continuous update)
- 13.inline,const,mutable,this,static
- A very detailed blog about the implementation of bilinear interpolation by opencv
- 20220606 关于矩阵的Young不等式
- Paging query template of Oracle
- GBase 8a磁盘问题及处理
- You don't know the usage of stringstream
- Yarn package management tool
- 消息中间件
- 浅析Visual Studio 使用
猜你喜欢
关于RSA加密解密原理
Simulink如何添加模块到Library Browser
A solution to create a new EXCEL workbook on win10 computer and change the suffix to xlsm (normally it should be xlsx)
消息中间件
网络安全漏洞分析之重定向漏洞分析
Qvector shallow copy performance test
File upload JS
Animation through svg
CentOS installing MySQL and setting up remote access
VI editor
随机推荐
Opencv gaussianblur() explanation (Sigma value)
ERP outlet
5. Attribute selector
Can I open an account for the reverse repurchase of treasury bonds? Can I directly open the security of securities companies on the app for the reverse repurchase of treasury bonds? How can I open an
教程篇(5.0) 02. 管理 * FortiEDR * Fortinet 网络安全专家 NSE 5
Tutorial (5.0) 01 Product introduction and installation * fortiedr * Fortinet network security expert NSE 5
Problèmes et traitement du disque gbase 8a
20211018 一些特殊矩阵
VI editor
0. some doubts about learning SolidWorks for the first time
20211004 矩阵的子空间
Vscode double shortcut keys up, down, left and right
centos 安装mysql及设置远程访问
What exactly is Huawei cloud desktop saying when it says "smooth"?
Loss outputs Nan for the Nan model
QML compilation specification
Knowledge points related to system architecture 1
Bash: kill: (74001) - operation not allowed
网络安全漏洞分析之重定向漏洞分析
20211108 微分跟踪器