该问题的出现通常是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

 

更多推荐