在子窗口里如何区分是由window.open打开的还是通过target="_blank"的? 试下if(opener==null){ alert("不是open窗口")} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script language="JavaScript"><!--function showWinName(){ alert (this.name);}//--></script> 1.htm<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title></head><body><a href="22.htm" target="_blank">fdsafdas</a><a href="22.htm" target="subwin">fdsafdas</a><a href="#" onclick="window.open('22.htm','thisisaopenwin')">fdsafdas</a></body></html>---------------22.htm<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title><script language="JavaScript"><!--function showWinName(){ alert (this.name);}//--></script></head><body onload="showWinName()"></body></html> 晕,不行,target="_blank"这样打出来的也有opener 哈,我的思路有问题,正转方式按fantiny的兄弟的思路想呢,没想到已经有答案了。:) 刚刚测试过了fantiny兄弟,赞一个:) target="_blank",子窗口的name应该是没有的吧?但是target="subwin",子窗口的name也有值了,和window.open(url,'subwin1')打开的子窗口一样。我遇到的问题是,要统一处理项目中子窗口,需要区分是由window.open打开的还是点击连接打开的。但是,由于项目已经接近尾声了,不同的程序员用window.open打开的窗口,有的有name,有的没有name....哭啊! 另外,如果一个连接的target是指向本窗口_self,那我按着shift+点击或者用IE右键中的“在新窗口中打开连接”所打开的窗口,是不是和target="_blank"一样呢? 求教:关于JavaScript控制<select>标签的问题 漂亮的弹出窗口是如何实现的啊? 菜鸟求救 高手大侠进 谢谢··· 小型B2C网站,用什么架构做比较合理? jquery load() 加载画面的问题。头疼啊! 广告图片随滚动条移动 非常简单,请教各位高手 在线等 调用打开对话框? 急!!!! 如何用window.open弹出一个屏幕居中的窗口? 急!!!! 50分求助!!!!!! 怎样用javascript生成 xml文件 如何获得二维数组第二维的长度?
<!--
function showWinName(){
alert (this.name);
}
//-->
</script>
<html>
<head>
<title> New Document </title>
</head><body>
<a href="22.htm" target="_blank">fdsafdas</a>
<a href="22.htm" target="subwin">fdsafdas</a>
<a href="#" onclick="window.open('22.htm','thisisaopenwin')">fdsafdas</a>
</body>
</html>---------------
22.htm<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
function showWinName(){
alert (this.name);
}
//-->
</script>
</head><body onload="showWinName()"></body>
</html>
fantiny兄弟,赞一个:)
但是target="subwin",子窗口的name也有值了,
和window.open(url,'subwin1')打开的子窗口一样。我遇到的问题是,要统一处理项目中子窗口,需要区分是由window.open打开的还是点击连接打开的。
但是,由于项目已经接近尾声了,不同的程序员用window.open打开的窗口,有的有name,有的没有name....哭啊!