首页 > 解决方案 > 自上次更新以来的 Chrome 阻止弹出窗口

问题描述

几天以来(可能是几周),chrome 阻止了我的 jQuery 函数,该函数在单击按钮时打开 2 个链接:

JS:

jQuery('.link').each(function(){
var th = jQuery(this);
th.on('click', function(){
window.location.href = th.attr('data-main-tab'),
window.open(th.attr('data-new-tab'), th.attr('_blank'));
});
});

HTML:

<a class="link" data-new-tab="?r=490098534" data-main-tab="https://example.com">Click Here</a>

关于如何解决这个问题的任何想法?

非常感谢!

标签: jquerypopuphref

解决方案


阻止或允许来自特定站点的弹出窗口:

  1. 转到阻止弹出窗口的页面。
  2. 在地址栏中,单击弹出窗口被阻止在此处输入图像描述
  3. 单击要查看的弹出窗口的链接。
  4. 要始终查看站点的弹出窗口,请选择始终允许来自 [您的站点] 的弹出窗口和重定向
  5. 完毕

推荐阅读