Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems verifying a location in frames

    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"

    Code:
    <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":

    Code:
    <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.
    Last edited by debt; 05-21-2005 at 02:17 AM.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't get information from/about windows/frames that contain documents that come from another domain.

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there anyway to circumvent the security restriction?

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For IE, developing your page as a .hta application will allow it, as may some ActiveX junk.

    For Gecko-browsers, the function netscape.security.PrivilegeManager.enablePrivilege(privilege) will ask the user if they want to grant your page the power to do potentially bad things.

    Unless you're doing this for an internal application, where you can force users to accept .hta/ActiveX/enhanced-privileges, forget it.

  • #5
    New to the CF scene
    Join Date
    May 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow. Thanks for the tip. I have all the functionality I need now using the .hta extension. I love you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •