window.opener.location.href == "url";
解决方案 »
- chrome在提交input type=file时,会出现“未选择文件”
- window.showModalDialog提交表单后自动关闭问题
- 急求一份js日历源码
- 不显示删除回复显示所有回复显示星级回复显示得分回复 html 用js直接加载webservice xml对象,list对象
- 如何在打开页面的时候将该页面套入到一个FrameSet中?(已经问过一贴,本贴解决,两贴的分数全部给你)
- *********很简单的问题,请高手帮忙 ***********
- 我想学习web控件技术,请问用什么语言开发出的控件综合性能最好呢?
- location.replace()的用法正确吗?在线等待。。。。
- 隐藏FAME
- 有4到5组checkbox,怎样实现点击每组的第一个checkbox就选中这一组checkbox
- 请问如何使用Javascript实现添加新的记录到Select选框里面
- 把javascript 得到的结果A放在SRC里面
知道url怎么写我不知道,不好意思,直接写给我好吗?因为javascript确实很不熟悉,几乎没有用过
可以获取父窗口的URL
昨天谢谢你,今天的问题也很白痴,可是我不会,没办法。现在不是找父窗口,是判断一个窗口是不是关闭着还是打开着。直到URL。你只要告诉我怎么写就可以了。没有那么麻烦的
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head><body>
<script language='javascript'>var newwin;
function openWin(url){
if(newwin == null || newwin.closed)
newwin=window.open(url);
}</script><input type='button' value='打开百度' onclick='openWin("http://www.baidu.com")'>
</body>
</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> </head> <body>
<script language='javascript'> var newwin;
function openWin(url){
if(newwin == null || newwin.closed)
newwin=window.open(url);
} </script> <input type='button' value='打开百度' onclick='openWin("http://www.baidu.com")'>
</body>
</html>
不好意思,好像我没有说明白,我需要判断这个已知URL是否是关闭的,如果关闭,下面还有很多处理
有这样的函数吗?
函数(url).closed == true 这种用法什么的?
if(newwin.closed == true)
{
alert(1111);
}
这样写
根本无法判断出来这个URL是关闭开始打开!
re:
不太明白,你用a,b,c,d,...说说你的流程或需求?
用什么方式打开的??
是用open方式吗?
他们属于父子关系,利用opener(B对A时)
opener.opener(C对A时)
opener.opener.opener(D对A时)等可以实现
向大家推荐一款功能强大的CF辅助程序,2008-10-3更新。具体功能请点击网址查看!
这个我也尝试过window.opener.opener.closed,无法在if语句里判断,原因我也不知道,5555555555
if (window.opener){
if (window.opener.closed == false) {
var msgContent = document.getElementById("lblMessage").innerText;
if((msgContent == "<%=this.GetMessage(PRConst.MSG_SUCCESS_APPL)%>") || window.opener.opener.closed )
{
//申込ポータルに遷移します。
window.opener.location.href = "<%=PRConst.FORM_MAIN_PORTAL_APPL%>";
}
else
{
// 親画面にフォーカス移動
window.opener.parent.window.focus();
// 親画面をリロードします。
window.opener.doPostBack('<%=PRConst.EVENT_TARGET_FINISH%>','');
}
}
}
// この画面を閉じる
window.close();
}不管那么多了,我把正短代码给你看看