【发布时间】:2018-05-20 00:15:39
【问题描述】:
我有一个基本的 jquery 问题。只是试图使此链接在新选项卡/窗口中打开。我添加了 _blank 但它没有转到新页面。有什么想法吗?
$('#link13').click(function() {
window.location.href= 'https://www.google.com','_blank';
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button type="button" class="btn btn-primary" id="link13">See the Resources</button>
【问题讨论】:
-
试试
window.open('https://www.google.com','_blank');
标签: jquery