Last Updated: February 25, 2016
·
490
· jcutrell

Quick and easy speedup for *most* mobile JavaScript

Listen for touchend instead of click if the device supports click. (Depends on Modernizr.)

var evt = (Modernizr.touch) ? "touchend" : "click";
$("body").on(evt, ".something", function(e){
    // do something
});