2 Replies Latest reply on Aug 14, 2007 9:17 AM by Newsgroup_User

    creating a "continue shopping" button

    PAWNJOB
      Is it possible to create a button on a website that simply goes back to the previous page in your browser as if you were just hitting the back button?
        • 1. Re: creating a "continue shopping" button
          Level 7
          <A href="javascript: history.go(-1)"><FONT face="Arial, Helvetica"
          size="2">Continue Shopping</FONT></A>


          "PAWNJOB" <webforumsuser@macromedia.com> wrote in message
          news:f9nqhp$1ve$1@forums.macromedia.com...
          > Is it possible to create a button on a website that simply goes back to
          > the previous page in your browser as if you were just hitting the back
          > button?


          • 2. Re: creating a &quot;continue shopping&quot; button
            Level 7
            .oO(Ken Binney)

            ><A href="javascript: history.go(-1)"><FONT face="Arial, Helvetica"
            >size="2">Continue Shopping</FONT></A>

            ... if you have JavaScript enabled and didn't come directly from a
            search engine to this page. And why the 1980's 'font' element?

            Every browser has a back function, it doesn't make sense to re-invent
            the wheel in this case. But if you really think there has to be a
            "continue shopping" link, then it should be done with server-side
            scripting, which is much more reliable than client-side stuff. It's
            quite easy to keep track of the previous URL with a session, which is
            required for a shopping cart anyway:

            * use two session variables $currentUrl and $parentUrl
            * on every page request store $currentUrl in $parentUrl and update
            $currentUrl with the currently requested URL

            With that it's easy to print a link to the "previous" page, which will
            work always.

            Micha