In previous post we saw how to get IE browser in JavaScript
In this post we wiil see how to detect IE browser using jQuery. jQuery have Browser object like Navigator object in JavaScript. And using Browser object we can get Browser name, version..etc.
jQuery to get IE browser
In this post we wiil see how to detect IE browser using jQuery. jQuery have Browser object like Navigator object in JavaScript. And using Browser object we can get Browser name, version..etc.
jQuery to get IE browser
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<title></title>
</head>
<script type="text/javascript">
function getBrowser() {
if ($.browser.msie) {
alert('Detected IE browser');
}
}
</script>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="getBrowser();" value="Get Browser Name"/>
</div>
</form>
</body>
</html>
Output This will show alert message Detected IE browser.