2 Replies Latest reply on Oct 27, 2008 1:07 PM by Newsgroup_User

    Go Back function

    paulkirtley Level 1
      In Dreamweaver CS3, I am using this bit of simple javascript to back up to the previous page:

      javascript: history.go(-1)

      You can see it here: http://pk-co.com/multifamily.html

      Here's my problem: If you notice, the "back up" function is taking you back to a page which uses a Spry Accordian widget. I need a way to get someone back to the same state of the Accordion they were in. What's happening is the "back function" takes a person back to the previous page instead of the previous page and the same state of the Accordian. For example, if one is on the fifth tier of the accordian when they go to the next page, I need for them to return to the same fifth level of the accordian and not the top of the list.

      I hope that is clear.

      If anyone knows how to do this, please let me know! Thanks
        • 1. Re: Go Back function
          Level 7
          Can't be done using this simple method, unfortunately. You would have to
          have the calling page save the menu's state before loading the target page
          either as a cookie, or as a URL variable in the link. Then the target page
          would have to parse that menu's state from the cookie or the variable, and
          pass it back to the proper page, which would also need to parse that
          information, and reset the menu.

          It's not an easy thing to do....

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "paulkirtley" <webforumsuser@macromedia.com> wrote in message
          news:ge52lm$afu$1@forums.macromedia.com...
          > In Dreamweaver CS3, I am using this bit of simple javascript to back up to
          > the
          > previous page:
          >
          > javascript: history.go(-1)
          >
          > You can see it here: http://pk-co.com/multifamily.html
          >
          > Here's my problem: If you notice, the "back up" function is taking you
          > back to
          > a page which uses a Spry Accordian widget. I need a way to get someone
          > back to
          > the same state of the Accordion they were in. What's happening is the
          > "back
          > function" takes a person back to the previous page instead of the previous
          > page
          > and the same state of the Accordian. For example, if one is on the fifth
          > tier
          > of the accordian when they go to the next page, I need for them to return
          > to
          > the same fifth level of the accordian and not the top of the list.
          >
          > I hope that is clear.
          >
          > If anyone knows how to do this, please let me know! Thanks
          >

          • 2. Re: Go Back function
            Level 7
            > I hope that is clear.
            >
            > If anyone knows how to do this, please let me know! Thanks

            This is a great example of the drawbacks to depending too much on javascript
            to change the UI.

            The only way to handle this is likely to use cookies. Upon each change of
            the accordion set a cookie, then upon each page-load of the page, check the
            cookie, and reset the accordion as needed.

            There really is no need for the 'back' link on your other page. The
            browser's back button works just fine.

            -Darrel