How to check if device is Windows Surface Tablet and browser is chrome or IE
问题 How to check if device is Windows Surface Tablet and browser is chrome or IE using Javascript. i have tried following code function is_touch_device() { try { document.createEvent("TouchEvent"); return true; } catch (e) { return false; } } if(is_touch_device() ) { if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1) { //some stuff } } i have searched for useragent but i an not getting exact for surface. how to check if device is surface and browser is chrome or IE 回答1: Using the