How to detect browser using jQuery?


Source Code:

<script src="http://api.jquery.com/jQuery.browser/"></script>
<script>
	$(document).ready(function(){
		// Opera
		if ($.browser.opera) {
			$(".yourclass").remove();
		}

		// Webkit
		if ($.browser.webkit) {
			alert( "this is webkit!" );
		}

		// MSI
		if ($.browser.msie) {
			alert( "this is webkit!" );
		}

		// Mozila
		if ($.browser.mozilla) {
			alert( "this is webkit!" );
		}
	});
</script>

Buy us coffee

Reviews and Comments