(function () {var ua = window.navigator.userAgent;var re =/android|ipod|itouch|iphone|ipad| blackberry| symbianos| symbos| Windows Phone os| wap| kindle|pad|pod/i;var iosre =/ipod|itouch|iphone/i;var ipadre =/ipad/i;var androidre =/android/i;if (Re.test (UA)) {//The current device is a mobile devicevar meta = document.getelementsbytagname (' meta ');var Ioslink,andriodlink,ipadlink,h5link;for (Var i=0;i<meta.length;i++) {if (Meta[i].getattribute (' name ') = = ' iOS ') {Ioslink=meta[i].getattribute (' content ');}else if (meta[i].getattribute (' name ') = = ' Android ') {Andriodlink=meta[i].getattribute (' content ');}else if (meta[i].getattribute (' name ') = = ' ipad ') {Ipadlink=meta[i].getattribute (' content ');}else if (meta[i].getattribute (' name ') = = ' h5 ') {H5link=meta[i].getattribute (' content ');}}var url = window.location.href; Current requestif (Url.indexof (' Openapp ') >=0) {//current request contains Openappif (Iosre.test (UA)) {//iOS deviceif (ioslink&&ioslink!= "") {window.location = Ioslink;}}else if (Ipadre.test (UA)) {//Ipadif (ipadlink&& Ipadlink!= "") {window.location = Ipadlink;} }else if (Androidre.test (UA)) {//Android device if (andriodlink&&andriodlink!= "") {document.writeln ("<iframe src=" "+andriodlink+" ' width= ' 100% ' height= ' 2300 ' scrolling= ' no ' Frameborder= ' 0 ' ></Iframe> "); }}else{//Other devices jump H5if (h5link&&h5link!= "") { window.location = H5link; }}if (h5link&&h5link!= "") { SetTimeout ("window.location = '" +h5link+ "';", 2000); }}}}) ();
Determine the current device type