SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript go back and refresh

    I'm using the following code to bounce the user back 2 pages.

    Is it possible to do a refresh as well. The reasoning behind this is that the user is updating info on a form and then the form pushes the user back to see the updated info. Using the code below the user can't see their changes until they do a manual refresh of the page.

    <script>
    history.go(-2);
    </script>

  2. #2
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not send them forward rather than back? That way the page will be refreshed automatically. ie window.location="url";

  3. #3
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The form the users enter info on will be accessible from anywhere in the site. On submit I want the user to be returned back to where they came from with all url parameters intact for that page. Kind of like when you try to post on a forum without logging in, you get directed to a login page then sent back to the page where you can post. Does this make sense?

    Quote Originally Posted by streetlife
    Why not send them forward rather than back? That way the page will be refreshed automatically. ie window.location="url";

  4. #4
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well save that url string into the session or a cookie or whatever, then upon completion of the form send them to that page.

  5. #5
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll probably end up doing that. Is there a way to do it with the javascript go back history code?

    Quote Originally Posted by streetlife
    Well save that url string into the session or a cookie or whatever, then upon completion of the form send them to that page.


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
  •