87,907
社区成员
发帖
与我相关
我的任务
分享
<div id="mydiv">
<iframe name="myiframe" width="195" height="126" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="a.asp"></iframe></div>
<div id="mydiv"></div>
<input type="button" value="插入iframe" onclick="javascript:iniframe();">
<script language="javascript">
function iniframe()
{
//插入iframe的代码
}
</script>
document.getElementById("mydiv").innerHTML =
'<iframe name="myiframe" width="195" height="126" marginwidth="0"
marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"
src="a.asp?'+Date.parse(new Date()) +'">
</iframe>'
if (!myiframe)
{
myiframe=document.createElement("iframe");
myiframe.name="showframe" ;
myiframe.width="195";
myiframe.height="126";
myiframe.marginwidth="0";
myiframe.marginheight="0";
myiframe.hspace="0";
myiframe.vspace="0";
myiframe.frameborder="0";
myiframe.scrolling="no";
myiframe.src="list.asp?act=show&id="+myid;
$("mydiv").appendChild(myiframe);// mydiv是一个已经存在的div
}