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

前端 未结 7 1835
名媛妹妹
名媛妹妹 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:44

    This is occasionally done. Youtube uses hashes to link to specific timestamps within a video.

    EDIT: I had assumed that you might have an issue where if the user goes up and manually edits the hash in the address bar, the page doesn't reload and even javascript will not know that it changed. I was wrong. I tried it on Youtube it works.

提交回复
热议问题