I know about setting and getting URL parameters, eg example.com/index.html?x=foo&y=bar&z=hello
would give your javascript access to the x
, y
, and z
variables specified in the URL.
What I wish for is the same behavior but utilizing the file path part of the URL. Eg example.com/index.html/foo/bar/hello
.
How can I accomplish this? In particular,
index.html
even though the file path index.html/foo/bar/hello
was specified?example.com/index.html/foo/bar/world
, such that if I press "Back" on the browser, it will go back to example.com/index.html/foo/bar/hello
.Furthermore, I'd heavily prefer if the solution was in pure javascript/html, without reliance on jquery or any other libraries.
There's 2 scenarios you should handle.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.