请问该如何写那段判断是否已经弹出那个UserName的窗口呢?
解决方案 »
- js传值取值的问题
- javascript中如何获得当前页面的尺寸?
- JS内存泄漏的问题.
- 问一下,弹出窗口关闭后如何回退到先前页面,还要回传一个参数,如何做
- 如何在子窗口内获取框架或者框架上其他子窗口内的变量值
- 脚本错误: document.all.recArchived.style.display 为空或不是对象
- 在jsp程序中嵌入了一段javascript,但是在ie中浏览时看不到效果怎么回事呀。在线急用!!!
- 请问如何判断一个用户输入的内容是否是“时间”类型的那?
- 能不能在网页生成后,对某个元素添加一个事件
- 我怎么样才能得到浏览器下的BUTTON表面的值呢?
- 如何在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;
}