【发布时间】:2021-07-27 22:51:50
【问题描述】:
我已经编写了一个事件来通过 jQuery 打开新的浏览器选项卡 (window.open),如下所示:
$(document).on('touchstart click', '.myClass', {self: this}, function (e) {
var mylink = e.data.self.validateDomValue(this, 'attr=data-affiliate')
if(myLink)
{
window.open(mylink, '_blank');
}
});
此脚本在 windows、mac 和 iPad 上运行良好,但在 iPhone 上出现了问题。该事件未针对 iPhone(版本:5、6 和 7)触发。我的错误是什么?您的任何建议将不胜感激。
【问题讨论】:
标签: jquery iphone click window.open touchstart