jquery - detecting mobile browser without user agent sniffing -
which approach more reliable detect mobile browser?
ua sniffing
jquery's
width()
as understand ua sniffing not reliable.
i need change html page according width of mobile device viewing page. can't media queries alone.
you can use mobile detect js library this. take note of warning:
// warning: // these javascript-based device detection features may work // newest generation of smartphones, such iphone, // android , palm webos devices. // these device detection features may not work older smartphones // had poor support javascript, including // older blackberry, palmos, , windows mobile devices. // additionally, because javascript support extremely poor among // 'feature phones', these features may not work @ on such devices. // better results, consider using server-based version of code, // such java, aps.net, php, or ruby.
Comments
Post a Comment