Not sure if there is a standard way to get there, but here's a non-standard technique that works with ie & ns differences built into the code. The dump routine just dumps all the properties and methods so I could try to track my way throw the collections (thought it might be useful).
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' />
<title>Frame A</title>
<script language='JavaScript' type='text/javascript'>
function tryThis(node) {
if (node.document) {
node.document.frames.parent.justForGrins("Internet Exploder");
alert(node.document.frames.parent.window);
} else if (node.ownerDocument) {
node.ownerDocument.defaultView.parent.justForGrins("NetScrape");
alert(node.ownerDocument.defaultView.parent.window);
} else {
alert("SOL");
}
}
function dump(myObj) {
if (myObj == null) {
document.write("null<br>");
} else {
document.write("<table border=\\"3\\">");
document.write("<tr><th>Property</th><th>Value</th><th>Type</th></tr>");
for (var i in myObj) {
document.write("<tr>");
document.write("<td width=\\"200\\">" + i);
document.write("<td width=\\"200\\">");
if (myObj[i] != null) {
if (typeof(myObj[i]) == "string") {
document.write("\\"" + myObj[i] + "\\"");
} else {
document.write(myObj[i]);
}
} else {
document.write("null");
}
document.write("<td width=\\"100\\">" + typeof(myObj[i]));
}
document.write("</table>");
}
document.write("<br>");
}
</script>
</head>
<body>
Frame A Contents
<form name='myform' action='framea.html'>
<input name='fred' type='button' value='say' onclick='tryThis(this);' />
</form>
<script language='JavaScript' type='text/javascript'>
var node = document.getElementsByName("fred").item(0);
dump(node);
if (node.document) {
dump(node.document.frames.parent);
} else {
dump(node.ownerDocument.defaultView.parent);
}
</script>
</body>
</html>