Don't. Or do, but don't do it exclusively. Don't lock yourself into the "touch version" of your site and the "mouse version." When you bind an event handler, don't do a if( 'ontouchstart' in document.documentElement){…}else{…} because many devices these days are both touch and mouse-enabled. The video below does a…
Category: JavaScript
JavaScript
Read more
navigator.sendBeacon()
Whenever you want to send a small amount of data to the server from client-side JS you almost always use AJAX, right? (Or, if you’re old enough, maybe a JS generated <img />.) For example, maybe you want to benchmark user actions or maybe you have your own special analytics….