I am trying to use a device and OS detection script and came across with this mobile detect js plugin. It seems pretty clean yet quite confusing.
GITHUB LINK and DOC LINK
It seems the documentation is not thorough and I am finding a bit confusing on how to create special cases. For example, what I am trying to do is to find whether user is visiting website using mobile or tablet and after that check is done the next step is to find the OS of the device.
function deviceDetectionScript() { var md = new MobileDetect(window.navigator.userAgent); if (md.mobile() && md.phone() && md.tablet()) { If(ios) { //do something } If(android) { //do something } If(windows) { //do something } } else { // do something else } } However, I am not sure the correct way to achieve this. Or is there any other way around to achieve the similar functionality without using this script?