+ -
当前位置:首页 → 问答吧 → 请教一个ie6的诡异问题。iframe内的select框莫名消失

请教一个ie6的诡异问题。iframe内的select框莫名消失

时间:2010-05-25

来源:互联网

首先这个问题可能有点偏,不想浪费时间的朋友请绕道吧。

下面的页面里嵌了一个iframe。将"iframe"插入到其他层时,
如果在操作appendChild前中断一小会,就会出问题:ie6下面,iframe里的select框会消失不见。
<div id="wrap"></div> <iframe id="moduleFrame" src="http://bbs.blueidea.com/search1.php" width="100%" height="560"></iframe> <script type="text/javascript"> var build = function() { var divModule =document.getElementById('wrap'); var divModuleFrame =document.getElementById("moduleFrame"); alert('延迟中断一下') //打断过之后,iframe里的select框就会消失。除了alert中断,setTimeout也一样。 divModule.appendChild(divModuleFrame); }; build(); </script>
 提示:您可以先修改部分代码再运行
下面是setTimeout延迟产生
<!doctype> <html> <head> <meta charset="UTF-8" /> </head> <body> <div id="wrap"></div> <iframe id="moduleFrame" src="http://bbs.blueidea.com/search1.php" width="100%" height="560"></iframe> <script type="text/javascript"> var build = function() { var divModule =document.getElementById('wrap'); var divModuleFrame =document.getElementById("moduleFrame"); divModule.appendChild(divModuleFrame); }; setTimeout(function(){build()},2000) //build(); </script> </body> <html>
 提示:您可以先修改部分代码再运行
百思不得其解这是哪门子bug,请各位鉴定。

作者: ONEBOYS   发布时间: 2010-05-25

用ietest可能没法直接测,需要在本地建文件测。

作者: ONEBOYS   发布时间: 2010-05-25

相关阅读 更多