我已经使用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)上没有触发。我的错误是什么?欢迎您的任何建议。