<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function CreateIframe(pid,id,n,url,s,a,w,h,fb,mw,mh)
{
var parentObj=document.getElementById(pid) //要插入的iframe的父元素的ID
var objTemp=document.createElement("iframe")
objTemp.setAttribute("id",id)
objTemp.setAttribute("name",n)
objTemp.setAttribute("src",url)
objTemp.setAttribute("scrolling",s)
objTemp.setAttribute("align",a)
objTemp.setAttribute("width",w)
objTemp.setAttribute("height",h)
objTemp.setAttribute("frameborder",fb)
objTemp.setAttribute("marginwidth",mw)
objTemp.setAttribute("marginheight",mh)
parentObj.appendChild(objTemp)
alert(parentObj.innerHTML)
}
</script>
</head>
<body>
<div id='a' style='width:200px;height:130px;'></div>
<script language="javascript">
CreateIframe("a","f","f","a.html","no","left","100","80","1","0","0")
</script></body>
</html>
解决方案 »
- 【新手报到】两道腾讯的笔试题
- 关于用new Date().getTime()得到当前秒数
- jquery中 ColorPicker如何放dialog里面
- 如何得到select 中上次选的selectedIndex?
- 在线等帮我改代码:我想实现下拉列表框中的项(视频路径)改变时realone播放相应的视频。
- 如何屏蔽IE的后退和前进按钮
- 关于函数window.open()函数
- 如何调用IE6.0的打印预览功能,谢谢!
- Naola2001(摆地摊)新做的日历控件,挑战"meizz(梅花雪疏影横斜)".整合时间输入部分.哈哈,顺便送分.
- 关于form 提交请求了两次的问题
- 各位朋友,请告诉我一下。跟随网页流动条滚动的一个DIV层,是怎么实现出来的?
- DIV嵌套问题
要这样
document.createElement("<iframe name=\"" + this._FrameName + "\">")
参考这里的iframe