Adam Khoury

Donate funds to show love and support

Click the button below to donate funds securely online. You can use your PayPal account or a credit card.

Your donations help free up my time to produce more content and assist in covering server costs. It's also a great way to say thanks for the content!

Application Configuration

Adam will be adding options here soon.

How to Detect User Browser JavaScript Tutorial

Published :
Author :
Adam Khoury

Learn how to detect the user browser software using JavaScript. There are various different ways to go about obtaining the result. This script is written to best convey the logic to someone new to programming. We also make special considerations for modern versions of Internet Explorer browser detection in this exercise.

example.html <script> var ba = ["Chrome","Firefox","Safari","Opera","MSIE","Trident","Edge"]; var b, ua = navigator.userAgent; for(var i=0; i < ba.length; i++){ if( ua.indexOf(ba[i]) > -1 ){ b = ba[i]; break; } } if(b == "MSIE" || b == "Trident" || b == "Edge"){ b = "Internet Explorer"; } alert("You are using " + b + " browser"); </script>