在完全加载之前关闭子页面时阻止刷新父页面

时间:2017-07-11 03:10:41

标签: javascript jquery html

当我使用window.open()方法打开子页面时。在关闭它之前完全加载子页面之前,它将刷新“ie-11”中的父页面。我想停止刷新父页面。 提前谢谢。

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<button onclick="openWindow()">
  OpenWindow
</button>

<script>
function openWindow(){
window.open(url, "_blank","height=200,width=200,status=1,toolbar=1,location=no,scrollbars=yes");
}
</script>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

试试这个:

function openWindow(e){

e.preventDefault(); window.open(url,“_ blank”,“height = 200,width = 200,status = 1,toolbar = 1,location = no,scrollbars = yes”);

}

相关问题