分享一段PC跳转手机版代码

一段js代码电脑跳转手机版

图片[1]-分享一段PC跳转手机版代码-智诚云集

<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跳转移动端 Xyok.Net
var thisUrl = window.location.href;
window.location.href = thisUrl.substr(0,thisUrl.lastIndexOf(‘/’)+1)+’wap/’;

}
}
urlredirect();
</script>

© 版权声明
THE END
喜欢就支持一下吧
分享
评论 抢沙发

    暂无评论内容