<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
var nw
function MM_openBrWindow(theURL,winName,features) { //v2.0
nw= window.open(theURL,winName,features);
}
function check()
{
if(!nw){alert("窗口还没有打开")}
else{nw.close()}
}
//-->
</script>
</head><body bgcolor="#FFFFFF">
<a href="#" onClick="check();MM_openBrWindow('popup.html','','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a>
</body>
</html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
var nw
function MM_openBrWindow(theURL,winName,features) { //v2.0
nw= window.open(theURL,winName,features);
}
function check()
{
if(!nw){alert("窗口还没有打开")}
else{nw.close()}
}
//-->
</script>
</head><body bgcolor="#FFFFFF">
<a href="#" onClick="check();MM_openBrWindow('popup.html','','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a>
</body>
</html>
解决方案 »
- 如何实现重启interval函数
- 最最复杂的一个JS效果,怎么实现
- 这种写法算递归吗?调用函数本身?
- java做的接口页面,在调用的时候,服务器端发生的onclick事件不能将值传到服务器外的文本框中,这个如何实现呢?
- 举国欢庆放假的时候,再散分散代码 ★HostEditor★ 梅雪香
- js怎样直接打印而不弹出打印对话框!
- 如何用纯javascript获取客户端的ip地址?
- **********为什么计算出来的直是NaN啊********************
- 兄弟们谁知道qq家园的那些物品摆放是用什么技术实现的??
- jquery datatable 插件前台输入查询条件,当我点击搜索时,第二次不向后台发起请求。
- 请高手帮忙,关于日期的,这个怎么写?
- 请教:关于页面中的隐藏某部分的问题
<a href="#" onClick="MM_openBrWindow('popup.html','openwin','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a>
</body>
</html>改成上面这样就可以了~~
window.open(theURL,winName,features);
}<a href="#" onClick="MM_openBrWindow('popup.html','win_1','scrollbars=yes,resizable=yes,width=320,height=120')">点击就弹出窗口</a> winName 起一个名字 win_1
每次点击都会把 popup.html 载入 name = win_1 的窗口