我试图从我的默认页面打开某个页面.默认页面中的所有代码都是:
<script type="text/javascript">
window.open("StartPage.aspx", "", "fullscreen=yes");
</script>
Run Code Online (Sandbox Code Playgroud)
问题是浏览器的弹出窗口阻止程序阻止了这一点,我需要允许浏览器打开它.我想避免这种情况,并且每个使用我的Web应用程序的人都不需要允许弹出窗口阻止程序打开页面.我想通过弹出窗口拦截器并在未经许可的情况下打开页面.
有办法吗?谢谢
Dav*_*und 13
adamantium是对的.如果弹出窗口阻止程序可能被导致弹出窗口的代码覆盖,那么弹出窗口阻止程序将毫无用处.你能做的最好的就是:
<script type="text/javascript">
var myPopup = window.open("StartPage.aspx", "", "fullscreen=yes");
if(!myPopup)
alert('a popup was blocked. please make an exception for this site in your popup blocker and try again');
</script>
Run Code Online (Sandbox Code Playgroud)