Skip to content Skip to sidebar Skip to footer

Window.parent.frames Don't Work In Firefox

alert(window.parent.frames.toolbar.location) the alert is undefined in Firefox, IE it work fine.

Solution 1:

Use this

alert(window.parent.frames[0].toolbar.location);

That should work.

As my comment said. window.frames is a list containing all frames in a window. You need to select the correct window, which I guess is the one with index 0.

Solution 2:

In Chrome and FF there's a difference if toolbar is either an id or a name of an (i)frame. .frames.id will refer to an actual (i)frame element (which doesn't have location property), .frames.name refers to the window within an (i)frame element. In IE both refer to the window within (i)frame.

A quick-fix would be to add also/use only name="toolbar" attribute to your (i)frame element.

Post a Comment for "Window.parent.frames Don't Work In Firefox"