在 Edge IE 模式下,當一個新視窗被迫出現在 MS Edge 上時,它會被添加到新選項卡而不是彈出視窗中。
當href從Edge IE模式到Edge時如何顯示新視窗?
---add-- 如果我必須強制 Edge 在 IE 模式下運行,我想在新視窗而不是新標簽中彈出。
https://i.stack.imgur.com/mOW95.png
<html>
<head>
<script type="text/javascript">
function test()
{
location.href = 'microsoft-edge:https://www.google.com';
}
function popup(){
let options = "toolbar=no,scrollbars=no,resizable=yes,status=no,menubar=no";
window.open("microsoft-edge:" "https://www.google.com", options);
}
</script>
</head>
<body>
<br>
<a href="microsoft-edge:https://www.google.com" rel="noopener noreferrer">href direct</a><br>
<br>
<a href="#" onclick="test();">location</a><br>
<br>
<a href="#" onclick="popup();">window open</a><br>
<br>
<a href="microsoft-edge:http://www.google.com" onclick="window.open(this.href,'_blank');return false;">onclick</a>
</body>
</html>
uj5u.com熱心網友回復:
首先,如果您未在 IE 模式串列中配置站點,它將默認以 Microsoft Edge 而不是 Edge IE 模式打開站點。
其次,如果需要打開一個新視窗,可以在windowFeatures引數中添加高度和寬度window.open(),如下所示:
function popup() {
let options = "toolbar=no,scrollbars=no,resizable=yes,status=no,menubar=no,height=450,width=720";
window.open("https://www.google.com","Popup", options);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/512489.html
標籤:IE浏览器
