如何判读打开的是pc端和移动端 分别加载不同的htmllet ua = window.navigator.userAgent.toLocaleLowerCase() let murl ="//m.jd.com" let reg =/iphone|android|symbianos|windowssphone/g if (reg .test(ua )) { window.location.href = murl }