BLOG

Javascript Detect any Browser and Browser Version

Since jQuery 1.9.0 removed the jQuery.browser functionality, I compiled some useful functions to replicate that functionality.
[raw]

function is_ie(){
    if (navigator.appVersion.indexOf("MSIE") != -1){
    	return true;
    };
    return false;
};
function is_firefox(){
    if (navigator.userAgent.indexOf("Firefox") != -1){
    	return true;
    };
    return false;
};
function is_opera(){
    if (navigator.userAgent.indexOf("Opera") != -1){
    	return true;
    };
    return false;
};
function is_chrome(){
      return navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
};
function is_safari(){
      return navigator.userAgent.toLowerCase().indexOf('safari') > -1;
};
function version_ie(){
      return parseFloat(navigator.appVersion.split("MSIE")[1]);
};
function version_firefox(){
if (/Firefox[/s](d+.d+)/.test(navigator.userAgent)){
var aversion=new Number(RegExp.$1);
return(aversion);
};
};
function version_opera(){
if (/Opera[/s](d+.d+)/.test(navigator.userAgent)){
var aversion=new Number(RegExp.$1);
return(aversion);
};
};
function is_ios() {
    return ((navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPod") != -1) || (navigator.platform.indexOf("iPad") != -1 || (navigator.platform.indexOf("Android") != -1))
        );
}
function is_android() {
    //return true;
    return (navigator.platform.indexOf("Android") != -1);
}

[/raw]

  • fruitfoodie
    March 11, 2015 at 11:01 am

    Just wanted to give a quick shout out and say that I genuinely enjoy reading your articles.

  • showcarsupplyauto
    March 15, 2015 at 9:46 pm

    Advantages of Getting Applied Vehicles available for purchase On the web

  • sneakyhealth
    May 30, 2015 at 11:14 am

    Excellent. one of the best articles I have every read. This is the information which I have been searching. Great information.

  • caring4thecaregiver
    June 2, 2015 at 11:17 pm

    I enjoy what you guys are usually up too. This type of clever work and exposure! Keep up the amazing works guys I’ve incorporated you guys to my personal blogroll.

  • stillhouseranch
    June 9, 2015 at 6:11 pm

    We enjoy for our long-sufferings to experience pleasure, however whereas they get steels, we are hardly ecstatic about them eating truly clammy further chewy brittle that can respite their girds. We promote them to calm go external plus maneuver or refreshment, yet thereupon batch around the sweeten for the viscous sate also we volition purchase that backward

Leave a comment

Your email address will not be published

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

10 + = 12

{"type":"main_options","images_arr":"'#ffffff'","enable_ajax":"off","soundcloud_apikey":"","bg_isparallax":"off","bg_slideshow_time":"0","bg_transition":"slidedown","site_url":"http:\/\/digitalzoomstudio.net","theme_url":"http:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","blur_ammount":"26","width_column":"50","width_section_bg":"","width_gap":"30","border_width":"0","border_color":"#ffffff","translate_leave_a_comment":"Leave a comment","translate_leave_a_comment_to":"Leave a comment to","is_customize_preview":"off","width_blur_margin":"30","gallery_w_thumbs_autoplay_videos":"off","enable_native_scrollbar":"on","content_enviroment_opacity":"30","menu_enviroment_opacity":"70"}
{"type":"darkfull"}