Answer the question
In order to leave comments, you need to log in
Why are JS functions not being called on iPhone 4?
Today, for the first time, I encountered such a problem: on the iPhone 4 (9.3.5) and iPad 2 (8.2), the functions I created are not called. At the same time, everything works clearly in the iPhone 5S (10.0.1).
Works:
<button type="button" onclick="alert('test')">test</button>
<script>
$('#test').on('click', function(){alert('test')};
</script>
<button type="button" id="test">test</button>
<script>function test() {alert('test');}</script>
<button type="button" onclick="test()">test</button>
<script>var test = function () {alert('test');}</script>
<button type="button" onclick="test()">test</button>
<script>
$('#test').on('click', function(){
test();
};
function test() {alert('test');}
</script>
<button type="button" id="test">test</button>
Answer the question
In order to leave comments, you need to log in
click is for mice.
tap event on phones, maybe that's why it doesn't work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question