1.父页面window.open()打开新页面var targetWeb=null;if(targetWeb){
targetWeb.focus();
}else{
targetWeb=window.open('https://segmentfault.com','segmentfault');
}2.子页面中关闭父页面window.opener.close();发现子页面无法关闭父页面,会提示:Scripts may close only the windows that were opened by it但若换成:window.opener.location.href='https://www.hao123.com' 却可以,请问是什么原因
添加回答
举报
0/150
提交
取消