1

In my HTML page I have an onClick event which navigates to next page. When this is opened in UIWebView for iOS 5 it works perfectly, but this is not working in iOS 6. I am unable to navigate to another page.

I thought iOS 6 doesn't support onClick events, we have to support onClick event, as we need get this work on both iOS6 and iOS5. I have created a small JS function, which I feel this could fix my issue.

<img src="resources/images/arrowRight.png" id = "rightArrow" class="arrowNavRight"/>
<script>
    document.getElementById("rightArrow").onclick=function(){nextSlide()};
</script>

The above is what I have done to resolve the issue. It is working fine in Chrome but not in the app. I am very new in using Javascript. Has anyone else faced this issue?. Your help is highly appreciated.

2 Answers 2

2

If you are developing for mobile, you should use 'touchstart' rather than 'onclick'.

Also, if you are using Phonegap, I would suggest using Jquery and Jquery mobile.

0

I haven't written any script for it. I just used onTouchStart instead of onClick and it worked fine for me. Till iOS 5 it supported onClick, But the new iOS 6 is not supporting onClick.

<img src="resources/images/arrowRight.png" id = "rightArrow" class="arrowNavRight" onTouchStart = "nextSlide()"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.