该问题的出现通常是iframe中的src属性缺失引起的,解决方法如下:
1.创建一个只含有<html></html>的空白htm页面,把iframe的src属性赋值为该空白页面。
elmIfr = document.createElement("IFRAME"); elmIfr.scr="blank.html";
document.body.appendChild(elmIfr);
2.src = "javascript:void(0)". is working in IE and Firefox
3.In IE6 and Firefox, this could be fixed by src="spacer.gif" and put spacer.gif at your root. Once this image is cached at the browser and browser would not request this image and it should work irrespective of protocol.
4.src = "javascript:''", is working in IE6 SP2
修复iframe加载问题
本文介绍了解决iframe因src属性缺失而导致加载失败的问题。提供了多种解决方案,包括使用空白HTML页面、JavaScript伪协议、图片占位符及特定于IE浏览器的方法。
1253

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



