Closed Thread Icon

Topic awaiting preservation: Positioning Document (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8379" title="Pages that link to Topic awaiting preservation: Positioning Document (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Positioning Document <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 11-05-2002 08:50

Hello,
I am refreshing the parent window setting the window.location.replace property. I am then trying to position the client to a particular anchor on the page. However, when I invoke the anchor call (also using window.location.replace) the first call to "refresh" the page is ignored completely and I don't get a page refresh (but I do get a page reposition). Here is the code, and is there a better way to do this?:

var win;
var winPath;
win = window.opener.document;

if (win != null) {
winPath = win.location.pathname;
alert(winPath);
win.location.replace( winPath );

//position page if ID was passed
if (id != '') {
winPath = winPath + "#" + id;
win.location.replace( winPath );
}
}


karl@laketahoegymnasticscamp.com

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 11-05-2002 09:02

I'm using this now:
win.location=winPath;

in place of win.location.replace....

However, I am still having no luck with this. Its like the browser accepts a single refresh. I need to refresh the page (for roundtrip to server), then position to passed anchor id.
How combine these two?

*thinking I may have come up with a challenge for the javascript gurus here!!*



karl@laketahoegymnasticscamp.com

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 11-05-2002 09:39

*thinking outloud*
... that the location hash must occure after the browser is done loading, and that it can not occur simultaneous with the code that calls to refresh the page. Therefore, some sort of javascript call after the closing HTML tag (which I've got, but I don't know how to pass this function a parameter, like a querstring parameter). How do you read a querystring variable?




karl@laketahoegymnasticscamp.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 11-05-2002 15:20

Yup, you'll probably have to do it that way. (When a browser is given a location that's the same page with a different #..., it just jumps to that part of the page.)

The query string can be read with window.location.search. It includes the trailing question mark.

« BackwardsOnwards »

Show Forum Drop Down Menu