alert(parent.document.all.url.value);

解决方案 »

  1.   

    alert(parent.url.value);因为不是包含在form里面的,直接操作就行了
    如果在form里面,写成alert(parent.form.url.value);
      

  2.   

    alert(window.top.document.all("url").value);
      

  3.   

    alert(parent.document.getElementById('url').value);
      

  4.   

    parent.document.getElementById('url').value
    或者parent.document.url.value应该都可以的。
      

  5.   

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <script language="javascript">
    function test()
    {
    alert(document.all.url.value);
    }
    </script>
    </HEAD>
    <body>
    <Input name="url" type=text id="url" size=30 value="123">
    <a href="#" onclick="test();">test</a>
    <br />
    <iframe id="fra1" src="test2.htm"></body>
    </HTML>test2.htm<HTML>
    <HEAD>
    <TITLE></TITLE>
    <script language="javascript">
    function test()
    {
    alert(parent.document.all.url.value);
    }
    </script>
    </HEAD>
    <body>
    <a href="#" onclick="test();">test</a>
    </body>
    </HTML>