How can I change the page URL without refreshing the page?

前端 未结 4 505
日久生厌
日久生厌 2020-11-30 23:46

How do I change the URL without refreshing the page?

I\'ve built a website with CodeIginer and I want to implement AJAX and JQuery in one of my pages. The problem is

4条回答
  •  春和景丽
    2020-12-01 00:31

    Could use a hash (#) and put whatever you like afterwards.

    Here's a site I built using this - and then I have JavaScript read the hash and call appropriate functions:

    http://bannerhouse.com.au/#/popup=media&id=don

    Side note:

    This is useful for flash websites or flash content as well; you can use FlashVars to parse the hash value to the SWF and load an appropriate section/screen based on that.

提交回复
热议问题