<!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>