js 关闭页面(Scripts may close only the windows that were opened by it.)
来源:互联网 发布:mac word选项 编辑:程序博客网 时间:2024/06/06 23:51
js关闭当前页面,当该页面不是其他页面打开的,而是直接输入url,
直接用window.close()无法关闭。
以下代码可以实现不同浏览器的关闭操作:
function closewin(){ if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") !=-1) { window.location.href="about:blank"; window.close(); } else { window.opener = null; window.open("", "_self"); window.close(); }}
1 0
- js 关闭页面(Scripts may close only the windows that were opened by it.)
- JS倒计时结束关闭页面:Scripts may close only the windows that were opened by it.
- js点击关闭当前浏览器Scripts may close only the windows that were opened by it.
- window.close()提示 "Scripts may close only the windows that were opened by it"
- [乐意黎原创] window.close()提示 "Scripts may close only the windows that were opened by it"
- window.close() doesn't work - Scripts may not close windows that were not opened by script.
- Application did not close the cursor or database object that was opened here 异常
- Why is the window.close() works in IE browser but not FireFox? "Warning: Scripts may not close windo
- CCS5导入工程时出错:Issues that may require your attention were encountered while importing the projects
- The AssetBundle could not be loaded because it references scripts that are not compatible ...
- resolve the issue of "the machine is dead" caused by that /dev/ttyUSB2 cann't be opened
- Fixing "The following VMware kernal modules have been found on your system that were not installed by the VMware installer."
- Fixing "The following VMware kernal modules have been found on your system that were not installed by the VMware installer."
- windows.close()关闭IE时不提示的JS方法
- JavaScript无提示关闭当前页面窗口,兼容IE/Firefox/Chrome (Close the current page window without confirm by JavaScript, support all browsers)
- js实现关闭本页面,window.close()真的不能关闭chorm浏览器的页面吗?
- window.close() 直接关闭页面
- When connecting to SQL Server 2005, this failure may be caused by the fact that under the defa
- 使用jquery的change事件操作<select>的事件处理
- 网络通信tcp的困惑和解决(一)
- POJ - 3320 Jessica's Reading Problem 尺取法+映射 重庆一中高2018级竞赛班第三次测试 2016.7.24 Problem 4
- 封装的意义和喻义
- CoordinatorLayout + AppBarLayout + SwipeRefreshLayout在eclipse上使用的方法和问题记录
- js 关闭页面(Scripts may close only the windows that were opened by it.)
- 【HDU】1130 - How Many Trees?(java - BigDecimal & 卡特兰大数打表)
- 今日头条 木棒拼图
- Shell_Find
- 从OpenCV源码学习cpp_explicit
- 顺序结构演示案例
- 微信公众平台开发----自定义菜单、消息处理及获取OpenID(C#)
- xcode调试之断点调试及动态输出
- loadmorerecyclerview GitHub项目使用