In project development, it will be encountered that opening pages in different devices are different, such as:
I open a website in mobile phone and open a website in pc, the page is different
The specific implementation is as follows
/ / Determine the terminal that opens the website var ua = window.navigator.userAgent.toLocaleLowerCase() var reg =/iphone|android|symbianos|windows\sphone/g if (reg .test(ua )) { window.location.href = 'The address opened by the mobile terminal' }else{ window.location.href = 'The address opened on the pc side' }