some javascript functions don't work on iOS devices (iPhone, iPad)

跟風遠走 提交于 2020-01-05 03:46:49

问题


hope you can help me. I'm freaking out after spending several days trying to solve this problem.

My JavaScript mouse event functions don't work on iOS devices. I red this apple article and i added to my html tags this attribute: onclick="void(0)" but it just doesn't want to work. i can trigger an alert message on any mouse events like this:

document.getElementById("el").addEventListener("mousedown", function(){
alert("Bla-Bla");
)};

but stuff like this inside the same eventlistener is not being executed:

document.getElementById("el").classList.remove("bla-class");

does somebody maybe know if there is a solution for this problem?


回答1:


The problem could not be on your code, the thing is that regularlly JavaScript is not eneble for browsers in IOS, so you can try go to settings > safaria > advanced > JavaScript and enable it, that's it, i hope this help you.

That life gives you good code



来源:https://stackoverflow.com/questions/37143619/some-javascript-functions-dont-work-on-ios-devices-iphone-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!