试试:
var oIframe = document.createElement('iframe');
oIframe.src=url;
oIframe.height='100%';
oIframe.width='100%';
winBody.appendChild(oIframe);
var oIframe = document.createElement('iframe');
oIframe.src=url;
oIframe.height='100%';
oIframe.width='100%';
winBody.appendChild(oIframe);
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html,body { height:100%;margin:Auto }
</style>
</head>
<body>
<script type="text/javascript">
title = "title"
MAX_Z_INDEX = 100
width = height = 600
var url = "http://www.google.com/"
var winPanel=document.createElement("div");
var winBody=document.createElement("div");
var winBar=document.createElement("div");
winBar.innerHTML="<table width='100%' border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >"+
"<tr>"+
"<td bgcolor=\"#0000FF\" height='25' > </td>"+
"<td width=\"100%\" bgcolor=\"#0000FF\"><strong>"+title+"</strong></td>"+
"<td bgcolor=\"#0000FF\" width='20'><img src=\"../images/publish_x.png\" id=\"flow_close\" title='close'> </td>"+
"</tr>"+
"</table>";
winBody.innerHTML="<iframe src='"+url+"' width=\"100%\" height=\"100%\" ></iframe>";//-----------就这一句...刷新一下才会显示...很晕啊..请高人指点
winPanel.insertAdjacentElement("beforeEnd",winBody);
winBody.insertAdjacentElement("afterBegin",winBar);
winPanel.style.position = "absolute";
winPanel.style.zIndex = MAX_Z_INDEX;
winPanel.style.width=width;
winPanel.style.height=height;
winPanel.style.top = (document.body.offsetHeight-500)/2 + document.body.scrollTop;
winPanel.style.left =(document.body.offsetWidth-400)/2;
document.body.appendChild(winPanel);
</script>
</body>
</html>