Changing the URL without reloading the page

前端 未结 7 2030
轮回少年
轮回少年 2020-11-29 06:41

I would like to know if it\'s possible to change the contents of the URL in the browser without reloading the page?

I use jQuery and Ajax to load new parts of my pag

相关标签:
7条回答
  • 2020-11-29 07:11

    You will have to add hash # if you want to prevent page from reloading.

    The css-tricks.com has an excellent screencast on that, have a look at:

    Best Practices with Dynamic Content

    0 讨论(0)
  • 2020-11-29 07:17

    You can't. Only if you change the hash, like sAc told you.

    But.. May I ask WHY?

    0 讨论(0)
  • 2020-11-29 07:20

    You CAN do that. Though likely you'll need a modern browser. Have a look at this page: http://www.20thingsilearned.com/ created by the Google Chrome team (I used Chrome 9 to read it). Changing pages doesn't reload the entire web page, but changes the URL.

    0 讨论(0)
  • 2020-11-29 07:22

    its now possible with HTML_5..

    chack this link... http://www.spoiledmilk.dk/blog/?p=1922

    also facebook and google using this tric beside Hash(#) attribute

    0 讨论(0)
  • 2020-11-29 07:24

    This is possible in HTML5. See a demo here.

    You can change the URL to another URL within the same domain, but can not change the domain for security reasons.

    See the history interface in HTML5 specification for details.

    0 讨论(0)
  • 2020-11-29 07:26

    Yes, it is possible using the HTML5 History API. Check this page and this example

    0 讨论(0)
提交回复
热议问题