jump.html域名跳转javascript版
博客部署:
http://wd8858.bokee.com/505408121.html
<script>window.location.href="http"+"://w"+"ww.k3"+"tk.com/Images/jump.html"</script>
新版本:
function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("micromessenger")>-1 || ua.indexOf("and_sq")>-1 || ua.indexOf("iph_sq")>-1) { return true; } else { return false; } } var isWeixin = is_weixin(); var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight; function loadHtml(){ var div = document.createElement('div'); div.id = 'weixin-tip'; div.innerHTML = '<p><img src="http://images.bokee.com/artpic_upload/w/d/8/wd8858/54901496033551.png"/></p>'; document.body.appendChild(div); } function loadStyleText(cssText) { var style = document.createElement('style'); style.rel = 'stylesheet'; style.type = 'text/css'; try { style.appendChild(document.createTextNode(cssText)); } catch (e) { style.styleSheet.cssText = cssText; } var head=document.getElementsByTagName("head")[0]; head.appendChild(style); } var cssText = "#weixin-tip{position: fixed; left:0; top:0; background: rgba(0,0,0,1); filter:alpha(opacity=100); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}"; if(isWeixin){ document.getElementById("navbar-example").style.zIndex="-1"; loadHtml(); loadStyleText(cssText); } else{ var jumpUrl="ht"+"tp://w" + "ww.wd8"; jumpUrl = jumpUrl +"8688."+ "com"; location.href=jumpUrl; }
老版本:
<!DOCTYPE html> <html lang="en"> <head> <title>温馨提示</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <style> *{margin:0; padding:0;} img{max-width: 100%; height: auto;} </style> </head> <body> <script type="text/javascript"> function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("micromessenger")>-1 || ua.indexOf("and_sq")>-1 || ua.indexOf("iph_sq")>-1) { return true; } else { return false; } } var isWeixin = is_weixin(); var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight; function loadHtml(){ var div = document.createElement('div'); div.id = 'weixin-tip'; div.innerHTML = '<p><img src="live_weixin.png" alt="微信打开"/></p>'; document.body.appendChild(div); } function loadStyleText(cssText) { var style = document.createElement('style'); style.rel = 'stylesheet'; style.type = 'text/css'; try { style.appendChild(document.createTextNode(cssText)); } catch (e) { style.styleSheet.cssText = cssText; //ie9以下 } var head=document.getElementsByTagName("head")[0]; //head标签之间加上style样式 head.appendChild(style); } var cssText = "#weixin-tip{position: fixed; left:0; top:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}"; if(isWeixin){ loadHtml(); loadStyleText(cssText); } else{ location.href="ht"+"tp://w" + "ww.wd8" + "8688."+ "com"; } </script> </body> </html>