Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HTML 5 History - Ryan Mulligan

B044a0f039af800f4df09bf3b2465f18?s=47 Las Vegas Ruby Group
January 01, 2012

HTML 5 History - Ryan Mulligan


Las Vegas Ruby Group

January 01, 2012


  1. HTML 5 History Manipulation

  2. What is it? Changing the browser history, even the current

  3. Who's using it? Github, Facebook, etc.

  4. Do browsers support it? http://caniuse. com/#search=histor y

  5. What does it replace? Hash hacks, traditional navigation http://example.com/page1/?id=1#preview

  6. What can I do with it? add to history stack

    change top of stack
  7. Add to history stack window.history.pushState(data, title [, url ] )

    example: window.history.pushState("hello world"," Ryan's Presentation","/ryans-presentation");
  8. Modify the top of the stack window.history.replaceState(data, title [, url

    ] ) example: window.history.replaceState("hello world"," Ryan's Presentation","/ryans-presentation2");
  9. Why state? http://dev.w3. org/html5/spec-author- view/history.html#state- object

  10. Questions?