1. 程式人生 > >jq判斷是否是在微信中打開

jq判斷是否是在微信中打開

agent lower urn style class span navi case navig

根據根據navigator.userAgent判斷瀏覽器類型判斷頁面是否在微信瀏覽器中打開。

function is_weixn(){  
    var ua = navigator.userAgent.toLowerCase();  
    if(ua.match(/MicroMessenger/i)=="micromessenger") {  
        return true;  
    } else {  
        return false;  
    }  
}

jq判斷是否是在微信中打開