環境判斷:區別h5打開仍是weixin打開?

var source_platform = '' , pf_source = 2; //系統平臺
    //區別是不是 微信瀏覽器 , source_platform 系統平臺  2018.12.6新增
    var ua = navigator.userAgent, source_platform = '';
    if (ua.match(/MicroMessenger/i) == 'MicroMessenger'){
        //微信瀏覽器
        source_platform = 'weixin';
        pf_source = 3;
    }else {
        source_platform = 'H5';
        pf_source = 2;
    }
相關文章
相關標籤/搜索