SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: URL Tokens?

  1. #1
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URL Tokens?

    Hi,

    I'm working on a website (Magento Shopping Cart) and during checkout that has six steps and loads each with a javascript. When the customer clicks continue the next step "slides" in. The URL stays the same.

    But if the customer clicks his browsers back button it takes him back to the cart view page or what ever page he was on before going to checkout.

    I thought about somehow disabling his browsers back button or show an error if he clicks his back button. Because he'll lose his information for his order.

    I've been reading and it seems there might be something else better. Some kind of url token but I'm not sure what exactly that is. Ideally, I would like to make it so when he clicks his back button it takes him back one step in the checkout process. I thought if I could somehow add something in the URL that changes it (token?) then the back button would work like I would like.

    I'm not sure if this is a javascript problem or what?

    Any advice is weclome

    Thanks

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2011
    Location
    Kolding, Denmark
    Posts
    108
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    To save and later retrieve state of page html5 history api could be used http://diveintohtml5.info/history.html in addition data about cart contents can be stored in browsers localStorage. Or window.onbeforeunload event can be used to confirm user pressing back button, like gmail does.

  3. #3
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    Very interesting reading. Might be a little over my head thou.

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,891
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    Sounds like a job for History.js
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


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
  •