How to execute a js function based on url hash url#nameoffunction

后端 未结 5 1309
执念已碎
执念已碎 2021-01-02 09:08

I saw some of websites executes a JavaScript function based on has in the URL. For example,

when I access http://domain.com/jobs#test

then the website execut

5条回答
  •  鱼传尺愫
    2021-01-02 09:57

    You could use a library like YUI to do this more elegantly, Take a look at the YUI Browser History Manager

    http://developer.yahoo.com/yui/history/

提交回复
热议问题