Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to Detect User Browser JavaScript Programming

by
Category:javascript
javascript jquery
How to Detect User Browser JavaScript Programming

In this tutorial how to detect the user browser software using JavaScript. 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

<script>
	document.write(navigator.userAgent);
</script>

More Example

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

0 Comments


Html code work in comment box


Related Post