<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
<iframe name="i" src="1.htm">
</iframe>
<iframe name="i2" src="2.htm">
</iframe>
<input type="button" onClick="alert(window.i.window.document.location);" value="view1"/>
<input type="button" onClick="alert(window.i2.window.document.location);" value="view2"/>
</body>
</html>

解决方案 »

  1.   

    <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    </head><body>
    <iframe name="i" src="http://www.sina.com">
    </iframe>
    <iframe name="i2" src="http://www.163.com">
    </iframe>
    <input type="button" onClick="alert(window.i.window.document.location);" value="view1"/>
    <input type="button" onClick="alert(window.i2.window.document.location);" value="view2"/>
    </body>
    </html>
    为什么这样就得不到了呢?
      

  2.   

    window.i2.window.document.location
    这句不清楚什么意思吗???只能得到本地的.