Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
段JavaScript腳本程序, 負(fù)責(zé)關(guān)閉窗口, 如果網(wǎng)頁(yè)不是通過(guò)腳本程序打開(kāi)的(window.open()), 調(diào)用window.close()腳本關(guān)閉窗口前, 必須先將window.opener對(duì)象置為null,
否則瀏覽器(IE7、IE8)會(huì)彈出一個(gè)確定關(guān)閉的對(duì)話(huà)框。
解決方案有以下幾種方法:
1.指向自己關(guān)閉法
<script language="javaScript">
function closeWindow()
{
window.opener = null;
window.open(' ', '_self', ' ');
window.close();
}
</script>
<input type='button' value='關(guān)閉窗口' onClick="closeWindow()">
2.框架top關(guān)閉法
<script language="javaScript">
function closeWindow()
{
window.opener = null;
window.open('', '_top', '');
window.parent.close();
}
</script>
<input type='button' value='關(guān)閉窗口' onClick="closeWindow()">
3.另外還有一種網(wǎng)上常用的方法, 不過(guò)似乎對(duì)IE8不起作用但在IE6上是中簡(jiǎn)單的直接關(guān)閉的方法
者: Peter醬
轉(zhuǎn)發(fā)鏈接:https://mp.weixin.qq.com/s/o-YqWroltD_JISwQJasWZQ
個(gè)判斷頁(yè)面是否真的關(guān)閉和刷新的方法
*請(qǐng)認(rèn)真填寫(xiě)需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。