SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ajax pages with browser history?

    I am trying to achieve something like this:
    http://www.dripbook.com/jonnylichten...rtraits/#85325
    When you click on next image it loads a new image but also changes the url in the the browser to /#somenumber
    This is cool because you can hit back or forward on the browser like normal non-ajax browsing.
    Any ideas of doing something like this?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Just have the link href refer to #name and when you attach an onclick event to the link, don't cancel the default behaviour as is normally done by returning false, but return true instead (or just no return at all).
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •