Could a page display diferrent content if the URL hash changes?

前端 未结 7 1831
名媛妹妹
名媛妹妹 2021-01-14 15:24

How could a page display different content based on the URL hash?

I\'m not talking about the browser scrolling down to display the anchored section, but something li

7条回答
  •  心在旅途
    2021-01-14 15:45

    As JavaScript has access to the URL-string it could of course act differently on the contents of the url.

    I've occassionally seen something like this but I don't think that this is a good way to react unless in very specific uses.

    One of the uses I remember was TiddlyWiki using the after-portion of the hash to set preferences for the page rendering and such.

提交回复
热议问题