Touch event support detection

This is a test page associated with a blog post. Unfortunately Google Chrome (desktop) undermined this technique, but using a gesture event has overcome that.

Get an alert about the gesture event, telling you whether it has detected ongesturestart.

Currently this script gives good results for:

More testing needed!

Some sort of touch-device detection is needed because some things (e.g. styled select-box replacements) don't work well for touch devices, i.e. you need to use double-finger scrolling on the iPhone, but you can't tell that you need to.
(Try the country list towards the bottom of the link above.)

I'd assume these things don't work well on other touch devices either. However, if I could detect a touch device and not run a particular script, it could fall-back nicely to the non-JavaScript version.

Script to use

I've started using this for touch events support detection:

function touchDeviceTest() {
	var el = document.createElement('div');
	el.setAttribute('ongesturestart', 'return;');
	if(typeof el.ongesturestart == "function"){
		return true;
	}else {
		return false
	}
}