问题在注释中
<!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>
</head>
<body>
<script type="text/javascript">
function show_popup()
{
var p=window.createPopup()
var pbody=p.document.body;
//alert(p.window) 不知道怎么弹出p下面的window了
pbody.style.backgroundColor="lime"
pbody.style.border="solid black 1px"
pbody.innerHTML="<button id='xx'>Create pop-up!</button> "
p.show(150,150,200,50,document.body);
}
</script>
<button onclick="show_popup()">Create pop-up!</button>
</body>
</html>
<!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>
</head>
<body>
<script type="text/javascript">
function show_popup()
{
var p=window.createPopup()
var pbody=p.document.body;
//alert(p.window) 不知道怎么弹出p下面的window了
pbody.style.backgroundColor="lime"
pbody.style.border="solid black 1px"
pbody.innerHTML="<button id='xx'>Create pop-up!</button> "
p.show(150,150,200,50,document.body);
}
</script>
<button onclick="show_popup()">Create pop-up!</button>
</body>
</html>
在 createPopup中在弹出一个 window.createPopup
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Table</title>
</head><body >
<script type="text/javascript">
var a=b=10;
function show_popup(doc)
{
var p=doc.parentWindow.createPopup();
var pbody=p.document.body;
//alert(p.window) 不知道怎么弹出p下面的window了
pbody.style.backgroundColor="lime";
pbody.style.border="solid black 1px";
pbody.innerHTML="<button id='xx'>Create pop-up!</button>";
var botton = p.document.getElementById('xx');
var call = arguments.callee;
botton.onclick = function(){call(p.document)};
p.show(a,a,200,50,p.document.body);
a=a+2;
}
</script>
<button onclick="show_popup(document)">Create pop-up!</button>
</body>
</html>