我想在页面刷新时弹出一个窗口进行提示,若此窗口存在,就在这个窗口中显示,否则弹出新窗口,how to do ? window.open("http://www.csdn.net/","windowname","")只要你将 "windowname" 取成一样的就行了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head></head><script language="javascript">function inf(){ try{ newwin.document.body.innerHTML=''; newwin.document.write('使用旧窗口') newwin.focus() } catch(x){ newwin=window.open('','','width=100,height=100') newwin.document.write('开了一个新窗口,第一次提示') newwin.focus() }}</script><input type=button value=弹出题是 onclick="inf()"></body></html> <html><head></head><script language="javascript">function inf(){ try{ newwin.document.body.innerHTML=''; newwin.document.write('hello world') newwin.focus() } catch(x){ newwin=window.open('','newwin','width=100,height=100') newwin.document.write('hello world') newwin.focus() }}</script><body onunload=inf()></body></html> 【悲剧】全国各大网站 用JS显示时间都错误了…… (附代码) 超链接实现下载问题 求救,怎么利用JS在编辑器里面在任何模式下都取得代码模式的长度 htc是什么?怎么学习? 在线求:根据不同时间显示表格中背景图片的JS代码!!! 页面刷新简单问题,在线等,在线给分。 高手都来看看?如何在JavaScript中捕获session中的值?周末一起吃Pizza 大家帮忙看看这个怎么实现? 如何把这一段代码转成Javascript?急、 axios 跨域问题 这个问题能解决吗?高分求解。 求救!!! 怎么改变图片的连接??? 在线求答!!!!!
<head>
</head>
<script language="javascript">
function inf(){
try{
newwin.document.body.innerHTML='';
newwin.document.write('使用旧窗口')
newwin.focus()
}
catch(x){
newwin=window.open('','','width=100,height=100')
newwin.document.write('开了一个新窗口,第一次提示')
newwin.focus()
}
}
</script>
<input type=button value=弹出题是 onclick="inf()">
</body>
</html>
<head>
</head>
<script language="javascript">
function inf(){
try{
newwin.document.body.innerHTML='';
newwin.document.write('hello world')
newwin.focus()
}
catch(x){
newwin=window.open('','newwin','width=100,height=100')
newwin.document.write('hello world')
newwin.focus()
}
}
</script>
<body onunload=inf()>
</body>
</html>