我在Windows 10 Build 10586.122中,並且新Edge瀏覽器中的window.open方法不符合規範。Microsoft Edge window.open()不遵守第二個彈出窗口的寬度高度
如果使用https://msdn.microsoft.com/en-us/library/ms536651(v=vs.85).aspx中的示例代碼,並單擊以打開一個新窗口,它將打開一個具有正確寬度和高度的新窗口。但如果從第一個彈出窗口打開第二個新窗口,這將完全忽略寬度和高度,但與第一個彈出窗口大小相同。
例如:我有2個文件吹
文件1:sample1.html
<!DOCTYPE html>
<html>
<body onclick="myOpen();">
<p>Click this page and window.open() is called.</p>
<script>
function myOpen() {
window.open("Sample2.html", null, "height=200, width=400, status=yes, toolbar=no, menubar=no, location=no");
}
</script>
</body>
</html>
文件2:sample2.html
<!DOCTYPE html>
<html>
<body onclick="myOpen();">
<p>Click this page and window.open() is called.</p>
<script>
function myOpen() {
window.open("Sample1.html", null, "height=400, width=800, status=yes, toolbar=no, menubar=no, location=no");
}
</script>
</body>
</html>
你爲什麼把你的windows命名爲'null'? – Teemu
如果我在第二個參數中添加名稱,它仍然是一樣的,沒有任何改變。 –