how to change url at address bar without reloading the page

前端 未结 5 2083
梦如初夏
梦如初夏 2021-01-02 01:09

I have http://mysite.com/index.php.

And a sub menu

  • home => http://mysite.com/index.php
  • about us => http://mysite.com/about.us.php
  • pro
5条回答
  •  天涯浪人
    2021-01-02 01:22

    How does Shopify do it then? Go to their website, click on the Features link and you'll see the URL says:

    http://www.shopify.com/tour/sell-online

    Then click on any of the sub links and you'll see that the address in the URl changes without using a hash but there is no page flip.

    I don't think they are using ajax to change the content because it all appears to be included in hidden divs on the page, but regardless, you can apparently change the URL using client side tricks.

提交回复
热议问题