请问该如何写那段判断是否已经弹出那个UserName的窗口呢?
解决方案 »
- 贪吃蛇,需要高手帮下忙
- 谁帮我改以下Calendar.js,让它能在IE7下面也能正常运行
- 加载XML出错 Exception caught while loading book.xml: [object Error]
- firefox里判断一个图片无法加载?
- 如何在主框架页中得到子框架页的内容???100分不够可以再加!!!
- 我要在网页中设计一个在线播放一个媒体文件,如MP3,或一段影音文件,代码怎么写?请教,谢谢!在线等
- 关于图层的操作?
- 能否将页面信息保存在本地硬盘并编辑
- css 不规则的div怎么弄
- 试验了一下js中闭包的概念,发现没有达到我的预期,请教一下!
- 如何在Eclipse上检查JS的语法错误
- 请问childNodes是只能在xml中使用还是普通的HTML也行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript">
<!--
function contains(urlName)
{
if (this[urlName] != null) return true;
return false;
}
var urlList = new Object();
urlList.isContains = contains;function SendMessage(UserName)
{
var url = 'http://www.google.cn/';
//这里判断是否已经window.open了一个名字叫UserName的窗口,有的话alert个提示,没有则 open
if (urlList.isContains(UserName))
{
alert("The window has opened.\nWindow name: "+UserName);
}
else
{
urlList[UserName] = url;
window.open(url,UserName,'')
}
}
//-->
</script>
</head> <body>
<input type="button" value="google" onclick="SendMessage('google')" />
</body>
</html>
{
//这里判断是否已经window.open了一个名字叫UserName的窗口,有的话alert个提示,没有则
if(UserName!=null || UserName.lenght!="" )
{
window.open('我的地址',UserName,'')
}
else
{
alert('dddddddd');
}
}
n = "abc,edf,wer".split(',')
var w=new Array();
for (i=0;i<n.length;i++)
{
w[i]=window.open('',n[i]);
}
function chk()
{
for (i=0;i<n.length;i++)
{
var b=true
try{c=(w[i]&&w[i].document)}catch(e){b=false}
alert(n[i]+' 窗口 '+b?'打开':'关闭');
}
}
</script>
<INPUT type="button" value="Button" onclick="chk()">
你在当前页面自动打开某些窗口后,可随机关闭一些窗口,点按钮查看哪些还在打开着
function SendMessage(UserName)
{
if(exsit) alert("窗口已经存在");
else window.open('我的地址',UserName,'')
}
function SendMessage(UserName)
{
if(exsit) alert("窗口已经存在");
else window.open('我的地址',UserName,'');
exsit = true;
}