document.getElementById("iframe1").location.href

解决方案 »

  1.   

    window.frames["iframe1"].window.location.href
      

  2.   

    iframe中的内容不能跨域,本域内时可以的
      

  3.   


    <SCRIPT language='Jscript'>
    function fun1(){alert(document.all.frame1.src);}
    </SCRIPT><input type='button' name='tt' value='test00' onclick="document.all.frame1.src='http://www.baidu.com'" >
    <br>
    <input type='button' name='aa' value='test01' onclick='fun1();' >
    <br><IFRAME height='200' width='300' name='frame1' frameborder='2' src='http://www.126.com' marginwidth='2' >
    </IFRAME>