Introduction:
Here I will explain how to jQuery to get browser type and version or jQuery detect browser version and type in asp.net with example or jQuery find browser type / version with example. By using jQuery migrate plugin we can get browser type and veriosn with example.
Description:
In previous articles I explained jQuery load more records on button click in repeater, jQuery show asp.net exception message in ajax calls, jQuery check whether radiobutton selected or not, jQuery get radio button selected value by name, jQuery validate radiobuttonlist with example and many articles relating to css, AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to use jQuery to get browser version and type in asp.net with example.
In previous articles I explained jQuery load more records on button click in repeater, jQuery show asp.net exception message in ajax calls, jQuery check whether radiobutton selected or not, jQuery get radio button selected value by name, jQuery validate radiobuttonlist with example and many articles relating to css, AngularJS, jQuery, JavaScript and asp.net. Now I will explain how to use jQuery to get browser version and type in asp.net with example.
By using jQuery
migrate plugin we can find browser type and version for that we need to write
the code like as shown below
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript">
$(function () {
$.each($.browser, function (i, val) {
$("#lbltype").append( i + ' : ' + val + '<br/>');
});
})
</script>
|
“$.browser” property will help us to get browser type and version. If you want to check it in complete example you need to write the code like as shown below
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<title>jQuery Get/Detect Browser Type and Version in
Asp.net</title>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
</head>
<body>
<form id="form1" runat="server">
<table>
<tr><td> You Are Using Browser:</td>
</tr>
</table>
<label id="lbltype"
style=" font-size:xx-large; font-weight:bold"
/>
<script type="text/javascript">
$(function () {
$.each($.browser,
function (i, val) {
$("#lbltype").append( i + ' : ' + val + '<br/>');
});
})
</script>
</form>
</body>
</html>
|
Demo
For demo check below version details
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.