剛才在網上沖浪的適合,361模板發現一個很有意思的小代碼,分享給大家
<script type="text/javascript">UA = navigator.userAgent.toLowerCase();url = window.location;url = url.toString();if((UA.indexOf('iphone') != -1 || UA.indexOf('mobile') != -1 || UA.indexOf('android') != -1 || UA.indexOf('ipad') != -1 || UA.indexOf('windows ce') != -1 || UA.indexOf('ipod') != -1) && UA.indexOf('ipod') == -1) {url=url.replace("m.survivalescaperooms.com/nea/m1938-295","m.vevb.com/m465");Go(url);}function Go(url) { window.location = url;}</script>這段代碼放到網頁頁面的頭部,這個代碼就是告訴我,當你使用手機訪問這個頁面的適合,把原來訪問的地址m.survivalescaperooms.com/nea/m1938-295替換成m.vevb.com/m465這個地址,這個和外面前面介紹的根據來路設備跳轉有些相似但是還有些不同,特此收錄下來分享給大家。
以上就是判斷來路設備替換網址的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答