判断IOS和android(weex 项目)

var ua = window.navigator.userAgent;
           var isiOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
           if(!isiOS){ //android 端
              this.title = this.getUrlParam('title')||'default';
           }else{ //IOS端
               this.title = decodeURI(this.getUrlParam('title')||'');// decodeURI()转码
           }

猜你喜欢

转载自blog.csdn.net/sally18/article/details/85604275