This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes using window.location ???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "using window.location ????" Watch "using window.location ????" New topic

using window.location ????

Tom Hopkins

Joined: Aug 10, 2001
Posts: 14
I'm working on an app where one frame calls a servlet that does an xsl:sort to update an html doc. I'm using 'response.sendRedirect' to bring me back to the frame that called the servlet, but then I need to refresh the frame that displays the html that was just updated. I've been using 'parent.framename.location = relativeURL' to accomplish this, but with limited success. It seems to work only on every second update. I know the transform is successful and the html is updating every time, but the display frame doesn't update. I also dont' think its a caching problem, as I'm using
<META CONTENT="no-cache" HTTP-EQUIV="Pragma">
<META CONTENT="no-cache" HTTP-EQUIV="Cache-Control">
<META CONTENT="no-store" HTTP-EQUIV="Cache-Control">
in the head of the html doc. So is there another way to do this?
Thanks in advance
Tom Hopkins

Joined: Aug 10, 2001
Posts: 14
Thanks anyway, got it.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What was the problem?
Tom Hopkins

Joined: Aug 10, 2001
Posts: 14
You know I'm still not sure why this isn't working because I've used window.location=... before for similar purposes. I can only imagine it may have been a synchronization issue where perhaps the updated file was not available in time for the call to window.location. But thats just a guess. Anyway, I ended up setting the target attribute of the form I'm submitting to indicate the frame which should ultimately hold the resulting html and everything works fine (every time). Probably should have thought of this sooner.
It is sorta covered in the JavaRanch Style Guide.
subject: using window.location ????
It's not a secret anymore!