首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

请教打开窗口的有关问题

2012-03-23 
请问打开窗口的问题请问各位有没有做过那种效果第一次点击一个事件:弹出一个窗口newWin下一次点击:如果窗

请问打开窗口的问题
请问各位有没有做过那种效果
第一次点击一个事件:弹出一个窗口newWin
下一次点击:如果窗口newWin已经关闭,则重新打开该窗口newWin
如果没有关闭,则刷新该窗口newWin.

[解决办法]
可以。
a.html
<html><body>
<input type="button" value="btn" onclick="javascript:window.open('b.html?xx=xx','aaa','height=500, width=830');">

<input type="button" value="btn2" onclick="javascript:window.open('b.html?xx=yy','aaa','height=500, width=830');">
</body></html>

b.html

<html><body>
<script language="javascript">
document.write(location.href);
</script>
</body></html>


[解决办法]
window.open()的第二个参数一样就可以。

热点排行
Bad Request.