Computer Science Mojo

~ David's Notes on coding, software and computer science




Posts in the Android category

How to fix JavaScript 'e.pageX' returning 'nan' on Android

Category: Android     Tag: Android   JavaScript   Web   Mobile  
By: David     On: Sat 05 September 2015     
If your JavaScript touch code works perfectly on ios but does nothing on Android, "e.pageX" might be the problem. "e.pageX" simple does not work on Android and returns "not a number", though it works fine both on desktop browsers and ios Safari. Use "e.targetTouches[0].pageX" for Android to fix this problem.

Continue reading »