Using Jquery we can detect current browser and their version.
$(document).ready(function() {
if ($.browser.mozilla && $.browser.version >= "2.0" ){
alert('Mozilla above 1.9');
}
if( $.browser.safari ){
alert('Safari');
}
if( $.browser.opera){
alert('Opera');
}
if ($.browser.msie && $.browser.version <= 6 ){
alert('IE 6 or below version');
}
if ($.browser.msie && $.browser.version > 6){
alert('IE above 6');
}
});
Using ASP.NET
Response.Write("Request.Browser.Type--------------------->" + Request.Browser.Type);
Response.Write("<br/>Request.Browser.Version -----------> " + Request.Browser.Version);
Response.Write("<br/>Request.Browser.W3CDomVersion------->" + Request.Browser.W3CDomVersion);
Response.Write("<br/>Request.Browser.Browser------------->" + Request.Browser.Browser);
Response.Write("<br/>Request.Browser.Browsers------------>" + Request.Browser.Browsers);
Response.Write("<br/>Request.Browser.MajorVersion-------->" + Request.Browser.MajorVersion);
OUTPUT
Request.Browser.Type--------------------->IE10
Request.Browser.Version -----------> 10.0
Request.Browser.W3CDomVersion------->1.0
Request.Browser.Browser------------->IE
Request.Browser.Browsers------------>System.Collections.ArrayList
Request.Browser.MajorVersion-------->10
$(document).ready(function() {
if ($.browser.mozilla && $.browser.version >= "2.0" ){
alert('Mozilla above 1.9');
}
if( $.browser.safari ){
alert('Safari');
}
if( $.browser.opera){
alert('Opera');
}
if ($.browser.msie && $.browser.version <= 6 ){
alert('IE 6 or below version');
}
if ($.browser.msie && $.browser.version > 6){
alert('IE above 6');
}
});
Using ASP.NET
Response.Write("Request.Browser.Type--------------------->" + Request.Browser.Type);
Response.Write("<br/>Request.Browser.Version -----------> " + Request.Browser.Version);
Response.Write("<br/>Request.Browser.W3CDomVersion------->" + Request.Browser.W3CDomVersion);
Response.Write("<br/>Request.Browser.Browser------------->" + Request.Browser.Browser);
Response.Write("<br/>Request.Browser.Browsers------------>" + Request.Browser.Browsers);
Response.Write("<br/>Request.Browser.MajorVersion-------->" + Request.Browser.MajorVersion);
OUTPUT
Request.Browser.Type--------------------->IE10
Request.Browser.Version -----------> 10.0
Request.Browser.W3CDomVersion------->1.0
Request.Browser.Browser------------->IE
Request.Browser.Browsers------------>System.Collections.ArrayList
Request.Browser.MajorVersion-------->10
No comments:
Post a Comment