HTML5 history APi

后端 未结 2 1040
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-10 21:01

How do i use HTML5 history api. I did go through the https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history. That confused me. All that i want is to change the ur

2条回答
  •  隐瞒了意图╮
    2021-02-10 21:11

    Here are the best resources which I've come across (including the one you already mentioned, and a working code example):

    • MDC: Manipulating the Browser History - very basic native example
    • Dive into HTML5: Manipulating the HTML5 History API for Fun and Profit - good intro
    • Intelligent State Handling: - article about hashbangs VS hashes VS HTML5 History API - provides working code solutions.
    • Ajaxify a Website with the HTML5 History API using History.js and ScrollTo - working code example

    In regards to pitfalls give the "Intelligent State Handling" link a good read. In regards to backwards compatibility there is History.js which fixes the browsers bugs and provides an optional HTML4 hash fallback.

提交回复
热议问题