what is the # symbol in the url

后端 未结 5 972
失恋的感觉
失恋的感觉 2020-12-10 13:28

I went to some photo sharing site, so when I click the photo, it direct me to a url like

www.example.com/photoshare.php?photoid=1234445

. and w

5条回答
  •  天命终不由人
    2020-12-10 13:56

    It's called the fragment identifier. It identifies a "part" of the page. If there is an element with a name or id attribute equal to the fragment text, it will cause the page to scroll to that element. They're also used by rich JavaScript apps to refer to different parts of the app even though all the functionality is located on a single HTML page.

    Lately, you'll often see fragments that start with "#!". Although these are still technically just fragments that start with the ! character, that format was specified by Google to help make these AJAXy pseudo-pages crawlable.

提交回复
热议问题