I\'m testing on this page, and I\'m not sure what I\'m missing.
// Two frames on the page
> document.getElementsByTagName(\"frame\").length
2
// Same dom
You could use
parent.frame.location.href = ...
Where frame is the name/id of the frame you d like to change.
Greets Marc
The all-around way to getting a frame's contents is with something like this:
var theFrame = document.getElementsByTagName("frame")[0];
var theFrameDocument = theFrame.contentDocument || theFrame.contentWindow.document;
var button = theFrameDocument.getElementById("mybutton");
However, it is possible to get a <frame>
's document by using its name, like:
window.frames["frame_name"].document
if the HTML were:
<frame name="frame_name">...</frame>