I am trying for the long time to search the function that help to find the user browser name. I did my best but not any solution.
If there is not function so tell me How I can send this javascript value to email.
I try to send the a lot of time but it goes in this form userbrowser
while userbroswer should be chrome or something else. I try to use this on Local server without mail it's showing well but when it goes to mail it shows the script instead of information.
Code of js here:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
``<script type="text/javascript">
$browsers = ["Firefox", "Chrome", "Safari", "Opera",
"MSIE", "Trident", "Edge"];
$userbrowser
$useragent = navigator.userAgent;
for (var i = 0; i < browsers.length; i++) {
if( useragent.indexOf(browsers[i]) > -1 ) {
userbrowser = browsers[i];
break;
}
};
switch(userbrowser) {
case 'MSIE':
userbrowser = 'Internet Explorer';
break;
case 'Trident':
userbrowser = 'Internet Explorer';
break;
case 'Edge':
userbrowser = 'Internet Explorer';
break;
}
</script>