Accessing Frames

J

J. Moreno

Hi,

I'm looking at some old code, and am having a problem with IE having
changed how accesses an object:

pages = window.parent.frames.item(1).document.all("position");

This works under Win200 and 6.0.2800.1106.

But not under WinXp and 6.0.2900.2180.

Does anyone know what IE might be looking for?

Thanks,
 
R

Randy Webb

J. Moreno said the following on 7/28/2006 8:30 PM:
Hi,

I'm looking at some old code, and am having a problem with IE having
changed how accesses an object:

pages = window.parent.frames.item(1).document.all("position");

What does item(1) refer to?
What is "position"?
This works under Win200 and 6.0.2800.1106.

But not under WinXp and 6.0.2900.2180.

Does anyone know what IE might be looking for?

Not even MS is sure what IE might be looking for about 90% of the time.
 
J

J. Moreno

Randy Webb said:
J. Moreno said the following on 7/28/2006 8:30 PM:

What does item(1) refer to?

An individual frame. In FF window.parent.frame[1] works.
What is "position"?

An ID (yeah, I know, bad idea to have more than one element with the same
ID, I'll fix that next).
Not even MS is sure what IE might be looking for about 90% of the time.

Heh. But I need to find out what it wants this time...
 
K

Kevin Darling

J. Moreno said:
pages = window.parent.frames.item(1).document.all("position");

This works under Win200 and 6.0.2800.1106.
But not under WinXp and 6.0.2900.2180.

Didja already try debugging to see what fails? Like an alert and
removing the ending object each time until it works?

alert(window.parent.frames) etc.

What error did you get, btw? No permission or ?? W2K and XP seem
to sometimes have different security models.

Also, personally, I'd name the frames so you don't have to do the
frames.item(1) thingie. Ooops, never mind, I forgot that you said it
was old code.

Luck! - Kev
 
R

Randy Webb

J. Moreno said the following on 7/31/2006 12:08 PM:
Randy Webb said:
J. Moreno said the following on 7/28/2006 8:30 PM:
What does item(1) refer to?

An individual frame. In FF window.parent.frame[1] works.

IE only code, gotta love it.
An ID (yeah, I know, bad idea to have more than one element with the same
ID, I'll fix that next).

It's not just a "bad idea" as it is invalid HTML code and when presented
with invalid HTML anything goes.
Heh. But I need to find out what it wants this time...

Start with validating the HTML to make sure it isn't a multiple ID issue
as IE may make a collection of same-ID'ed elements (I don't remember to
be honest). Then, start debugging with alerts and find out what is
causing the error.
 
J

J. Moreno

Kevin Darling said:
Didja already try debugging to see what fails? Like an alert and
removing the ending object each time until it works?

alert(window.parent.frames) etc.

What error did you get, btw? No permission or ?? W2K and XP seem
to sometimes have different security models.

Yeah, it was a security problem -- MS's silly "Mark of the Web" wasn't on
the main page.
Also, personally, I'd name the frames so you don't have to do the
frames.item(1) thingie. Ooops, never mind, I forgot that you said it
was old code.

The frames were already named. Which means I can use
window.parent.frames.frameName, I just checked and IE recognizes it (both
on my development machine and when working).
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top