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