The first type: Direct JS script
<script type= "Text/javascript" >try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp")) {if (( Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)) {window.location= "http://www.laozuo.org (change to its own WAP site)";}}} catch (Err) {}</script>
The second kind, a little longer, references
function Uaredirect (murl) {try {ifnull) {return;} var urlhash = Window.location.hash; if (!urlhash.match ("Fromapp")) {if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)/catch(err) {}}
The above script is persisted to the Mobile.js file, and then the following 2 JS call files are referenced in the page that needs to be called.
<script src= "Mobile.js" type= "Text/javascript" ></script><script type= "Text/javascript" > Uaredirect ("http://www.laozuo.org (change to own WAP website)");</script>
Implement Web page only mobile-only access PC inaccessible