2012年12月23日 星期日

Javascript detect browser type

1. Problem:
Sometimes there are different present in the different browser, especially in IE and firefox-like. In this we should get the browser type and do the different method


2. Solution
/* To get the browser type */
function detectIsIEBrowser(){
    var isIE = false;
    var val = navigator.userAgent.toLowerCase();
   
    if(val.indexOf("msie") > -1) {
        isIE = true;
    }
    return isIE;
   
}




Reference
Basic
Advance_PPK

沒有留言:

張貼留言