Back Button, mod_rewrite and updating window.location without reloading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jwriteclub
    New Member
    • Jun 2007
    • 6

    Back Button, mod_rewrite and updating window.location without reloading

    I have a question regarding back button functionality in an "ajaxy" web application.

    Here is the scenario:
    • The user navigates to a page http://domain.com/app/.
    • Since app/index.php file contains [PHP]include['app.php'][/PHP] this really serves to load app/app.php which is the "ajaxy" application
    • The user loads data and otherwise "does stuff" with app.php
    • At some point, the user reaches a page they would like to be able to send to a friend/coworker/bookmarks service
    • At some point the user clicks the back button in their browser and is taken to the previous state of the application.


    My initial theory for this was to use the "Really Simple History" framework, however, I have spent a fruitless morning trying to make it work, and even then it is a hack at best.

    Currently, what I could like to do is update window.location .pathname. This would then allow some simple mod_rewrite rules so that if the page was loaded it could be sent values in the 'search' portion of the string.

    (to clarify, suppose the user bookmarked http://domain.com/app/foo/bar/ this could then load http://domain.com/app/app.php?1=foo&2 =bar)

    Furthermore, while I can handle immediate back and forward with a cookie or some other local data store, I would ideally like to be able to simply push new locations onto the history stack.

    Naturally, I have searched throughly around the 'usual places' and not found an answer to this question, so I doubt it is as easy as I want it to be, but any more or less working solution (even one without 'pretty links') would be more than welcome at this point.

    ~ Christopher
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TSDN!

    Having never tried this myself (never needed to), I can just suggest this. If that doesn't work, perhaps we can work with what code you have.

    Comment

    • jwriteclub
      New Member
      • Jun 2007
      • 6

      #3
      Thanks you for your reply. I had been hoping to avoid such a solution (it seems to me to lack a certain elegance that simply pushing onto the history stack would provide, but . . .).

      Am I the only person who thinks that the currently available methods to accomplish history are all "bad"?

      ~ Christopher

      Comment

      Working...