debt
05-21-2005, 01:47 AM
I made a code to show the CURRENT location of an opened window, but
the JS console in firefox gives me: "Error: uncaught exception: Permission denied to get property Location.href"
<html><head>
<script language="Javascript">
function newWin() {
BNEW=window.open("frames.htm", "BNEW");
BNEW.location.href = "frames.htm";
if (BNEW.opener == null) BNEW.opener = window;
}
function theLoc() {
document.write("<font face='arial' size='12' color='black'>"+BNEW.up.location.href+"</font>")
}
</script>
</head>
<body>
<input type="button" value="Open" onClick="newWin()">
<input type="button" value="Click" onClick="theLoc()">
</body>
</html>
Here's the code for "frames.htm":
<html>
<frameset rows="50%, 50%" frameborder="1">
<frame name="up" src="http://www.google.com">
<frame name="down" src="2.html">
</frameset>
</html>
Any help would be appreciated. Thanks.
the JS console in firefox gives me: "Error: uncaught exception: Permission denied to get property Location.href"
<html><head>
<script language="Javascript">
function newWin() {
BNEW=window.open("frames.htm", "BNEW");
BNEW.location.href = "frames.htm";
if (BNEW.opener == null) BNEW.opener = window;
}
function theLoc() {
document.write("<font face='arial' size='12' color='black'>"+BNEW.up.location.href+"</font>")
}
</script>
</head>
<body>
<input type="button" value="Open" onClick="newWin()">
<input type="button" value="Click" onClick="theLoc()">
</body>
</html>
Here's the code for "frames.htm":
<html>
<frameset rows="50%, 50%" frameborder="1">
<frame name="up" src="http://www.google.com">
<frame name="down" src="2.html">
</frameset>
</html>
Any help would be appreciated. Thanks.