Js determined whether the channel is open in the micro-browser

 

        // JS determines whether the micro channel opens in a browser 
        function is_weixn () {  
             var UA = navigator.userAgent.toLowerCase ();  
             IF (ua.match (/ MicroMessenger / I) == "micromessenger" ) {  
                 return  to true ;   
            } the else {  
                 return  to false ;   
            }   
        } 
        the console.log (is_weixn ());

Guess you like

Origin www.cnblogs.com/Knowledge-is-infinite/p/12042199.html