window.frames["Iframe1"].document.location兼容问题
在ie中使用window.frames["Iframe1"].document.location="";无任何问题,可在谷歌中出现location未定义错误
其真正原因还在浏览器的内核不一样,参照:http://blog.youkuaiyun.com/lzy_1515/article/details/6045629
所以将iframe的id和name设成一样的即可
<iframe frameborder="0" id="Iframe1" name="Iframe1" scrolling="yes" src="/maintenance/vehicle/EvaluationImgUrl.aspx"
style="visibility: inherit; width: 319px; z-index: 1; height: 350px;"></iframe>
在ie中使用window.frames["Iframe1"].document.location="";无任何问题,可在谷歌中出现location未定义错误
其真正原因还在浏览器的内核不一样,参照:http://blog.youkuaiyun.com/lzy_1515/article/details/6045629
所以将iframe的id和name设成一样的即可
<iframe frameborder="0" id="Iframe1" name="Iframe1" scrolling="yes" src="/maintenance/vehicle/EvaluationImgUrl.aspx"
style="visibility: inherit; width: 319px; z-index: 1; height: 350px;"></iframe>
本文探讨了在不同浏览器内核下iframe元素的兼容性问题,特别是在IE与谷歌浏览器中的表现差异。通过设置iframe的id和name属性为相同值来解决location未定义的问题。
1624

被折叠的 条评论
为什么被折叠?



