首页 > Web开发 > 详细

错误跳转js

时间:2017-03-14 18:39:00      阅读:2051      评论:0      收藏:0      [点我收藏+]

<script type="text/javascript">
var t = 5; //倒计时的秒数
function showTime(){
document.getElementById(‘time‘).innerHTML= t +"S后跳转到首页";
if(t==0){
var ua = navigator.userAgent;
if(ua.indexOf(‘iPhone‘)>=0){
window.location.href="openApp.jdmobile://virtual?params={\"category\":\"jump\",\"des\":\"HomePage\"}";
}
if(ua.indexOf(‘android‘)>=0){
window.location.href="openApp.jdMobile://360buy?type=1";
}
else {
window.location.href="http://m.jd.com";
}
}
t -= 1;
if(t>=0){
setTimeout("showTime()",1000);
}
}
window.onload=function(){ showTime();
}
</script>

错误跳转js

原文:http://www.cnblogs.com/freedommovie/p/6549797.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!