A.htm 里放的代码是 <iframe scrolling="no" width="840" height="240" frameborder="0" src="f.jsp?h=2&w=6&th=840&tw=240&bgc=ffffff&bdc=ffffff&fc=0066FF&fcfc=EFEFEF&type=1&username=1000xi"></iframe> f.jsp 中有一个通过脚本 top.location.href 获取地址的 然后B.htm 文件时是 <iframe scrolling="no" width="840" height="240" frameborder="0" src="A.htm"></iframe> 打开B.htm文件的时候,获取的当前地址不是B.htm 的地址,而是A.htm 的地址 使用iframe 嵌套的如果获取最顶上的当前地址,
比如A.htm里面有个iframe B.htm
B.htm里有个iframe C.htm
在C.htm里通过top.document.location就可以获得A的地址