jquery - 自上次更新以来的 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>
关于如何解决这个问题的任何想法?
非常感谢!
解决方案
推荐阅读
- r - “矢量化”具有不同参数长度的函数的最快方法
- php - 为什么 alexa amazon 不刷新 OAuth2.0 中过期的访问令牌
- machine-learning - sklearn标准化后如何取回原始值
- python - 在 Pytest 中重构测试逻辑以避免复杂的引发块
- bots - Bot检测识别字段
- r - 尝试使用 R 通过 SSL 连接到 Postgres 时由对等方重置连接
- python - Ajax 是一种安全的数据传递方式吗
- php - Symfony 5 - ManyToOne __isInitialized__: false
- vue.js - 如何断开组件 beforeDestroy 钩子中的 Vuetify v-intersect 观察者?
- bash - 在 CURL GET 中传递变量