ϵ½עᣬύѣøܣϴزIJޣ
Ҫ ¼ ſػ鿴û˺ţ¼ע
x
4GʱֻվѾdzձˣһֻվһʣ m.websjy.com ֱֻӷ www.websjy.com PCվֻվdzá ֻܹPC˵վԶתֻվͺˣ £ ´ҳ
- <SCRIPT LANGUAGE="JavaScript">
- function mobile_device_detect(url)
- {
- var thisOS=navigator.platform;
- var os=new Array("iPhone","iPod","iPad","android","Nokia","SymbianOS","Symbian","Windows Phone","Phone","Linux armv71","MAUI","UNTRUSTED/1.0","Windows CE","BlackBerry","IEMobile");
- for(var i=0;i<os.length;i++)
- {
- if(thisOS.match(os[i]))
- {
- window.location=url;
- }
-
- }
- //Ϊ൱ֵֻϵͳ֪Ϣ,ʱ
- if(navigator.platform.indexOf('iPad') != -1)
- {
- window.location=url;
- }
- //һΪAndroidֻںҲLinux
- //navigator.platformʾϢͬ,˴֣navigator.appVersionϢж
- var check = navigator.appVersion;
- if( check.match(/linux/i) )
- {
- //X11UCƽ̨ ҲԸ
- if(check.match(/mobile/i) || check.match(/X11/i))
- {
- window.location=url;
- }
- }
- //in_array
- Array.prototype.in_array = function(e)
- {
- for(i=0;i<this.length;i++)
- {
- if(this[i] == e)
- return true;
- }
- return false;
- }
- }
- mobile_device_detect("http://m.websjy.com");
- </SCRIPT>
ƴڶе http://m.websjy.com Ҫתַֻ
һֱȽϼJS룬ҲԵ - <script type="text/javascript">
- try {
- var urlhash = window.location.hash;
- if (!urlhash.match("fromapp"))
- {
- if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))
- {
- window.location="http://m.websjy.com";
- }
- }
- }
- catch(err)
- {
- }
- </script>
ƴ
룺
- <script type="text/javascript">
- // JavaScript Document
- function urlredirect() {
- var sUserAgent = navigator.userAgent.toLowerCase();
- if ((sUserAgent.match(/(ipod|iphone os|midp|ucweb|android|windows ce|windows mobile)/i))) {
- // PCתƶ
- var thisUrl = window.location.href;
- window.location.href = thisUrl.substr(0,thisUrl.lastIndexOf('/')+1)+'mobile/';
- }
- }
- urlredirect(<span style="line-height: 1.5;">"http://m.websjy.com"</span><span style="line-height: 1.5;">);</span>
ƴ
|