最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Microsoft Edge: window.open only works correctly at first attempt - Stack Overflow

programmeradmin0浏览0评论

In MS Edge (windows 10 build 10162), window.open call only works correctly the first time, but subsequent window.open calls only shows a blue screen with the e logo.

<body onclick="myOpen();">
    <p>Click this page and window.open() is called.</p>
    <script>
        function myOpen() {
            window.open("/", null, "height=200, width=400, status=yes, toolbar=no, menubar=no, location=no");
        }
    </script>
</body>

See demo here: / Click on the page, close the pop up window, and click on it again. There's a blue screen.

I filed another issue with window.open described in detail here, which appeared fixed at first, now I've run into this issue.

In MS Edge (windows 10 build 10162), window.open call only works correctly the first time, but subsequent window.open calls only shows a blue screen with the e logo.

<body onclick="myOpen();">
    <p>Click this page and window.open() is called.</p>
    <script>
        function myOpen() {
            window.open("http://jsfiddle/sbhat/f74wt293/", null, "height=200, width=400, status=yes, toolbar=no, menubar=no, location=no");
        }
    </script>
</body>

See demo here: http://jsfiddle/sbhat/f74wt293/1/ Click on the page, close the pop up window, and click on it again. There's a blue screen.

I filed another issue with window.open described in detail here, which appeared fixed at first, now I've run into this issue.

Share Improve this question edited May 23, 2017 at 11:44 CommunityBot 11 silver badge asked Jul 14, 2015 at 19:58 SudiSudi 1292 gold badges2 silver badges11 bronze badges 5
  • Also submitted connect.microsoft./IE/feedback/details/1546067 – Sudi Commented Jul 14, 2015 at 20:01
  • 1 So.. what are you asking? – Daedalus Commented Jul 16, 2015 at 0:05
  • 1 This issue appears to be fixed/resolved in Windows 10 Build 10240. (edited because the OP clearly mentioned their build.) – Ryan Joy Commented Jul 16, 2015 at 4:55
  • This is indeed fixed in build 10240. – Sudi Commented Jul 17, 2015 at 19:43
  • How can we pass some string value to that window? Can you please answer - stackoverflow./questions/34947586/… – Apparao Commented Jan 22, 2016 at 13:34
Add a ment  | 

4 Answers 4

Reset to default 3

The above answer is only partially correct. Build 10240 corrects the blank box when you open a window for the second time. However, new popup windows still open BEHIND the main browser window around 50% of the time. ie they do not automatically get focus. You only know they are there because the Edge icon on the task bar flashes.

On Build 10162, I got it working here on this JSFiddle http://jsfiddle/RamiSarieddine/wu09fh1d/2/

<a href="#" onclick="openUp()">Click this page and window.open() is called.</a>    
<button onclick="openUp()">Click me</button>

function openUp() {
    window.open("http://dev.modern.ie/munity/", "_blank", "height=200,width=400,scrollbars=yes,status=yes,location=no");
}    

you can see the window opening more than once and you can run the script and click multiple times and it still pops up

Try renaming your window name upon each open.

window.open(myURL, 'my_window_' + Math.random())

No longer an issue, this is fixed in windows 10 preview build 10240

发布评论

评论列表(0)

  1. 暂无评论