如何在 IE 中使用 target="_blank"?
How to use target="_blank" in IE?
我想在资源管理器中使用目标空白,但我不确定。
请告诉我如何修复它。
您使用的是什么版本的 Internet Explorer?
对我来说,我使用的是 IE11,它在这个版本中运行良好。
如果它不起作用,那么也可以使用此 JavaScript 代码,并将其调用到您的锚标记。
window.open('http://www.google.com','_blank')
您想在新的 window 或标签页中打开 link 吗?可以根据this article.
使用target="_blank"
我根据您在回答中的评论做了一个样本。您可以在文本框中输入网站值,它可以在 IE 的新选项卡中打开它:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
<input type="text" class="pdf-file-url" />
<a href="#" class="btnZoom" target="_blank">link</a>
<script>
$('.btnZoom').on("click", function () { $('.btnZoom').attr("href", $(".pdf-file-url").val()); });
</script>
</body>
</html>
结果:
如果不符合您的要求,请提供a minimal sample which can reproduce your issue. You can also see How to ask并编辑您的问题,而不是在评论中回复。
我想在资源管理器中使用目标空白,但我不确定。 请告诉我如何修复它。
您使用的是什么版本的 Internet Explorer?
对我来说,我使用的是 IE11,它在这个版本中运行良好。
如果它不起作用,那么也可以使用此 JavaScript 代码,并将其调用到您的锚标记。
window.open('http://www.google.com','_blank')
您想在新的 window 或标签页中打开 link 吗?可以根据this article.
使用target="_blank"
我根据您在回答中的评论做了一个样本。您可以在文本框中输入网站值,它可以在 IE 的新选项卡中打开它:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
<input type="text" class="pdf-file-url" />
<a href="#" class="btnZoom" target="_blank">link</a>
<script>
$('.btnZoom').on("click", function () { $('.btnZoom').attr("href", $(".pdf-file-url").val()); });
</script>
</body>
</html>
结果:
如果不符合您的要求,请提供a minimal sample which can reproduce your issue. You can also see How to ask并编辑您的问题,而不是在评论中回复。