当前位置:网站首页>""? "& 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
边栏推荐
- JS obtain geographic location information according to longitude and latitude and mark it on the map
- ADT Google browser plug-in ad Terminator
- Tutorial (5.0) 02 Management * fortiedr * Fortinet network security expert NSE 5
- What are the bank financial products? How long is the liquidation period?
- Pop component submission success failure animation
- 20211108 det(AB)=det(A)det(B)
- ES6 use of dynamic attributes
- Tutorial (5.0) 03 Security policy * fortiedr * Fortinet network security expert NSE 5
- 1. preliminary understanding of Express
- 如何成为白帽子黑客?我建议你从这几个阶段开始学习
猜你喜欢

About RSA encryption and decryption principle

Top+jstack to analyze the causes of excessive CPU

Loss outputs Nan for the Nan model

Uni app subcontracting loading and optimization

教程篇(5.0) 02. 管理 * FortiEDR * Fortinet 网络安全专家 NSE 5

Yarn package management tool

Some websites of QT (software download, help documents, etc.)

【网络安全渗透】如果你还不懂CSRF?这一篇让你彻底掌握

Problems in the deconstruction and assignment of objects, comparison between empty strings and undefined

redis
随机推荐
20211115 任意n阶方阵均与三角矩阵(上三角或者下三角)相似
【 sécurité 】 comment devenir ingénieur de sécurité de 0 à 1 contre - attaque pour la Fondation zéro
Diversified tables through TL table row consolidation
Object in ES6 Use of entries()
0. some doubts about learning SolidWorks for the first time
Detailed explanation of C language callback function
Tutorial (5.0) 01 Product introduction and installation * fortiedr * Fortinet network security expert NSE 5
Gbase 8A v95 vs v86 compression strategy analogy
Tutorial (5.0) 02 Management * fortiedr * Fortinet network security expert NSE 5
[network security penetration] if you don't understand CSRF? This article gives you a thorough grasp
13.inline,const,mutable,this,static
Animation through svg
Sonar scan ignores the specified file
20211006 积分、微分、投影均属于线性变换
Uni app subcontracting loading and optimization
教程篇(5.0) 04. Fortint云服务和脚本 * FortiEDR * Fortinet 网络安全专家 NSE 5
ES6 use of dynamic attributes
Invalid flex layout setting width
How to resolve "the operation cannot be completed successfully because the file contains viruses or potentially junk software
Replace jade engine with EJS