邯郸手机靓号出售群:如何在一个页面内设置多个弹出窗口

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 16:08:35
我想在同一个页面点击不同链接弹出页面大小相同,但内容不同的网页,用以下代码点击链接却只能弹出同一个页面,能有别的方法实现吗?
<html>
<head>
<script LANGUAGE="javascript">
<!--
function openwin(){
window.open("page.html","newwindow","height=100,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,
location=no,status=no";)
//写成一行
}
-->
</script>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">function openwin(){window.open('001.htm','001','status=yes,scrollbars=yes,resizable=yes,width=400,height=500,top=0,left=0')}</script><a href="#" onclick="openwin()">1</a>
<script language="JavaScript" type="text/JavaScript">function openwin(){window.open('002.htm','002','status=yes,scrollbars=yes,resizable=yes,width=400,height=500,top=0,left=0')}</script><a href="#" onclick="openwin()">2</a>
</body>
</html>

定义函数的时候加一个参数,调用时给参数赋值就行

如何在一个页面内设置多个弹出窗口
悬赏分:0 - 离问题结束还有 7 天 17 小时
我想在同一个页面点击不同链接弹出页面大小相同,但内容不同的网页,用以下代码点击链接却只能弹出同一个页面,能有别的方法实现吗?
<html>
<head>
<script LANGUAGE="javascript">
<!--
function openwin(htmurl){
window.open(htmurl,"newwindow","height=100,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,
location=no,status=no";)
//写成一行
}
-->
</script> 调用时写成
<a href="#" onclick="openwin("001.htm")">1</a>
<a href="#" onclick="openwin("002.htm")">2</a>