javascript - How to check if device is Windows Surface Tablet and browser is chrome or IE -
how check if device windows surface tablet , browser chrome or ie using javascript. 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 useragent not getting exact surface. how check if device surface , browser chrome or ie
using navigator object can access these data fields
navigator.appname <- gets app name may misleading appcodename navigator.appcodename; <-- alternate name navigator.platform; <-- platform user on
Comments
Post a Comment