var popupWindow=null;
function popup()
{
popupWindow = window.open('child_page.html','name','width=200,height=200');
}
function parent_disable() {
if(popupWindow && !popupWindow.closed)
popupWindow.focus();
}
,然后在
<body onFocus="parent_disable();" onclick="parent_disable();">
正如你在这里要求的父窗口的body标签声明这些功能是父窗口的新
<html>
<head>
<script type="text/javascript">
var popupWindow=null;
function child_open()
{
popupWindow =window.open('new.jsp',"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=600, height=280,top=200,left=200");
}
function parent_disable() {
if(popupWindow && !popupWindow.closed)
popupWindow.focus();
}
</script>
</head>
<body onFocus="parent_disable();" onclick="parent_disable();">
<a href="javascript:child_open()">Click me</a>
</body>
</html>
内容的完整的HTML代码.jsp
<html>
<body>
I am child
</body>
</html>
来源
2011-04-14 09:09:12
anu
你是什么意思的“禁用父窗口”? – atlavis 2011-04-14 08:53:47
你是什么意思desabled? – 2011-04-14 08:54:10
禁用意味着不允许用户在父窗口中选择说出的文本..实际上不允许他选择父项上的任何内容。 – testndtv 2011-04-14 10:15:35