首先这个限制不是JS的限制, 是你浏览器的安全机制, 不能赖在JS头上.
其次这个限制当然要加上, 否则通过浏览器可以干很多坏事了.

解决方案 »

  1.   

    那你有没有更改它的安全限制试一下。
    看看可不可以,不行的话试试把url地址换种方式再传过去。
      

  2.   

    换个方法试试看
    不要用window.parent.leftFrame.location.href
    先用
    window.leftFrame.location.href
    读取放到主窗口里面,然后再说
      

  3.   

    window.leftFrame.location.href是错误的啊!
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    <script language="javascript">
      
       
      
         //alert( window.parent.leftFrame.location.href);
         //alert(window.parent.location.href);
         alert(window.leftFrame.location.href);
         
    </script></head><frameset rows="*" framespacing="0" frameborder="NO" border="0">
      <frameset cols="80%,*" framespacing="0" frameborder="NO" border="0">
          <frame src="http://www.google.com" name="leftFrame" scrolling="NO" noresize>
          <frame src="right.htm" name="mainFrame">
      </frameset>
    </frameset><noframes>
      <body>
      </body>
    </noframes>
    </html>
    上面报对象找不到错误,
      

  4.   

    看我得,测试绝对正确,要是有问题,在问我.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><frameset rows="*" cols="833,*" framespacing="0" frameborder="NO" border="0">
      <frame src="http://www.google.com" name="leftFrame" scrolling="NO" noresize>
      <frame src="right.htm" name="mainFrame">
    </frameset>
    <noframes><body>
    </body></noframes>
    </html>
    =====================================
    左子页面
    =====================================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    left
    </body>
    </html>
    =====================================
    右子页面
    =====================================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <script language="javascript">
      
       function getURL()
       {
         alert(window.parent.document.getElementsByName("leftFrame")[0].src)  
       }
    </script><body>
    right
    <input type=button name="testURL" value="getURL" onclick="getURL()"></body>
    </html>
    ===================================
      

  5.   

    楼上的大侠你好,你的方法是可以得到左窗口的url地址,但是当url地址被改变了之后,比如用户点击了超链接,使用了google的搜索,他的url地址都改变了,但是你的方法得到的永远是原来的(http://www.google.com)。
    你可还有办法实现我的要求啊?就是不断获取左子窗口的url,我是用来实现同步浏览功能之用。
    我目前是使用了一个delphi程序,通过applet调用得到当前同步浏览的url。再发送到客户端的
      

  6.   

    普通的JS是不可以跨域操作的, 包括取跨域的URL, 不可以...