Like segmentfault.com/faq#q8, the content after '#' is not only positioned at a location, but also performs certain operations. How is it achieved?

WBOY
Release: 2016-07-06 13:54:18
Original
1073 people have browsed it

For example, [http://loadpage.b0.upaiyun.com/#http://www.baidu.com] (the brackets are a complete address)
Accessing this page will redirect you Go to the URL after "#".
Can the content after "#" be obtained? Should I use js to get it on the front end or on the server side?

Reply content:

For example, [http://loadpage.b0.upaiyun.com/#http://www.baidu.com] (the brackets are a complete address)
Accessing this page will redirect you Go to the URL after "#".
Can the content after "#" be obtained? Should I use js to get it on the front end or on the server side?

Using location.hash in js is # and the content after it.

Like segmentfault.com/faq#q8, the content after '#' is not only positioned at a location, but also performs certain operations. How is it achieved?

As follows, assuming your file name is index.html, when you visit index.html#windows.com, you will be redirected to windows.com


Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!