错误跳转js

<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>

上一篇:C++-不要在构造和析构函数中调用虚函数


下一篇:Hive之 hive与hadoop的联系