$().ready(function(){
var userAgent = navigator.userAgent.toLowerCase();
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
var browserName = '';
var version = '';
var displayPop = false;
var chromeversion=11; //working when chrome have version below 11
var safariversion=5; //working when safari have version below 5
var firefoxversion=3.6; //working when firefox have version below 3.6
var miseversion=9; //working when ie have version below 9
var operaversion=10; //working when opera have version below 10
if ($.browser.chrome) {
userAgent = userAgent.substring(userAgent.indexOf('chrome/') + 7);
userAgent = userAgent.substring(0, userAgent.indexOf('.'));
$.browser.version = userAgent;
$.browser.safari = false;
browserName = 'Chrome';
version = $.browser.version;
displayPop= parseInt(version) < chromeversion ? true : false;
} else if ($.browser.safari) {
userAgent = userAgent.substring(userAgent.indexOf('version/') + 8);
userAgent = userAgent.substring(0, userAgent.indexOf(' '));
$.browser.version = userAgent;
$.browser.safari = false;
browserName = 'Safari';
version = $.browser.version;
displayPop= parseInt(version) < safariversion ? true : false;
} else if ($.browser.mozilla) {
browserName = 'Mozilla';
var ver = userAgent.split('firefox/');
version = ver[1];
displayPop= parseFloat(version) < firefoxversion ? true : false;
} else if ($.browser.msie) {
browserName = 'IE';
version = $.browser.version;
displayPop= parseInt(version) < miseversion ? true : false;
}
if (displayPop) {
alert(browserName); // current browser name
alert(version);// current version of the browser
$('h1').html('Lower version!'); // write your code
}
});