#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    2
    Rep Power
    0

    Angry


    I need a simple way to move to a generated page and have it REFRESHED - like using the 'refresh' button. I was given the following code and it doesn't work (though the guy who gave it to me swears it 'should'). The page is being output by a Java servlet.

    "<input type=button value=Back onClick='.location.replace(sReferringPage)'>");

    OR
    //out.println("<input type=button value=Back onClick='.location.replace('URL')'>");

    What's the EXACT syntax?

    I get a 'page error' message when I run it in IE 5.5.
    Any help would be greatly appreciated. It would be idea if I could capture the calling pages URL into a variable and use it rather than hardcoding the 'URL' portion of the method.

    Any pointers to books that explain these seemingly tasks would be greatly appreciated.

    Comments on this post

    • JimmyGosling agrees
  2. #2
  3. film at 11
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Portland, OR
    Posts
    413
    Rep Power
    14
    You need this HTML:
    <input type="button" value="Back" onClick="parent.location='mypage';">

    Wrap that in an out.println(). An easy way to make sure it's not cached is to include the system time in the request:
    Code:
    out.println("<... onClick=\"parent.location='mypage?time="+System.currentTimeMillis()+"';\">");

IMN logo majestic logo threadwatch logo seochat tools logo