Can't send frame to a URL a second time IN IE5...

M

Mandy

This fails only in IE 5. It works flawlessly in IE5.5+, Netscape, Opera and Mozilla.

I'm using javascript to navigate in my content. I can load the starting page just fine (page0.html). Any subsequent use of the below
function does nothing.

I'm testing tURL, and it contains the correct URL (page1.html), and also testing that parent.frames.moduleFrame.location.href
returns the current page's URL, which it does.

Code:

function redrawPage(){
var tURL;
if(this.modType == "lesson")
tURL = "page" + this.currentPage + ".html";
else
tURL = "moduleDisplay.html";
parent.frames.moduleFrame.location.href = tURL;
}

These pages do employ document.write to write contents.

PLEASE help!
 
V

VK

parent.frames.moduleFrame.location.href = tURL;

try instead:
window.top.moduleFrame.location.href=tURL
(more reliable)

Also "this" is a very fancy girl sometimes, acting rather like "that"
(meaning "hell knows what I'm pointing to"). Except referencing the parent
form from within a form element, I'd suggest always use the object name
itself (unless you are extending the "window" object and this function is a
method of your customary object, which I cannot tell from this snip).

After that it should work.
 
M

Mandy

It is being used in a custom object, which is the "this", in this case. The object is used to maintain state on the client-side.

I can't go from window.top as this frameset could be nested 4-40 deep, and I will have no control over the number of levels... only
the direct relationship between the target frame and it's parent.

What could possibly cause a frame which is known to exist, and can be queried for name/id, to not allow location.href assignment
and also not throw an error?

BTW: thank you for your quick response to my original.
 
V

VK

parent.frames.moduleFrame.location.href = tURL;

This statement is using the "Sloppy Joe's Syntacs" - maybe IE 5.0 is just
less tolerant as other browsers?

Try the conventional syntacs:
parent.frames('moduleFrame').location.href=tURL

Tell me if it helps.
 
M

Michael Winter

[snip]
Try the conventional syntacs:
parent.frames('moduleFrame').location.href=tURL

That isn't conventional. The frames collection is just that: a collection.
It is not a function[1]. Use square brackets:

frames['moduleFrame']

[snip]

Mike


[1] Some browsers might allow it, but it's probably just to be compatible
with IE. Square brackets should be supported by all browsers.
 
M

Mandy

Cleaned it up and it still didn't work.

Strange quirk: I notice that if I [SHIFT]+click on the link that calls the function, while it does open a page in a new window, the
ORIGINAL windows DOES advance to the correct URL.

WTH?!?!?
 
V

VK

Do you have a link to look at?

Also just for a hell of it check that all test browsers have equal security
settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top