zoukankan      html  css  js  c++  java
  • 时间倒计时

    $(function(){
        var m=$("#Countdown").val();
        var s=$("#CountdownSecond").val();
        setInterval(function(){
            if(s<10){
                $('#time').html(m+':0'+s);
            }else{
                $('#time').html(m+':'+s);
            }
            s--;
            if(s<0){
                s=59;
                m--;
            }
            if (m<0) {
                $.ajax({
                        type: "POST",
                        url: "__MODULE__/Order/destroyOrder/Oid/"+$("#orderId").val()+".html",
                        data: {Oid:$("#orderId").val()},
                        dateType: "html",
                        success: function(data) {
                            if(data==1){
                                alert("支付时间已到,订单已取消!");
                            }
                            document.location.href="{:U('Order/Order/userOrderList')}";
                        },
                        error: function(request) {
                            alert("Connection error");
                        }
                    });
                }
        },1000)
    })
      <input type="hidden" value="{$orderInfo['id']}" id="orderId">
            <input type="hidden" value="{$Countdown}" id="Countdown">
            <input type="hidden" value="{$CountdownSecond}" id="CountdownSecond">
  • 相关阅读:
    python 小练习 5
    python 小练习4
    python 小练习3
    python 小练习2
    遇到后缀名为whl的库的安装方法
    hdu1394Minimum Inversion Number
    Triangle
    codeforces B. Pasha and String
    F
    C
  • 原文地址:https://www.cnblogs.com/yongwang/p/7039475.html
Copyright © 2011-2022 走看看