I'm new in this board but I have read you for years. :)
I'm trying to learn to code, but I'm in the first steps yet. However, I'm going to use a script to detect the user's browser.
This work with all the mainly browser (I tried it on chrome, firefox and IE), but it doesn't work with Edge. How can I fix it? Thank you!
<p style="text-align: center;">Hi user, you're using:
<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 20+"){
b = "Internet Explorer";
}
document.write(b + " browser");
</script>