0

i am really stucked with this problem. First i have tried many times and it work well. But suddenly, this countdown not work anymore, i have tried to alert error but there is no error. i don't know whats wrong with my code. Maybe someone can help me to figure it out. By the way i am using keithwood countdown

var reachZeroOn;
$(function () {
    $.ajax({
        url: host+'/skripsi3/phpmobile/getdatetenant.php',
        data: { "idacara":getacara,"idtenant":user,"nomor":nomor},
        dataType: 'json',
        success: function(data){
            var tgl2=data.deadline.split(" ");

            var tgl=tgl2[0].split("-");
            var tgl3=tgl2[1].split(":");
            var nm=(tgl[1]*1)-1;

            reachZeroOn=new Date(tgl[0],nm,tgl[2],tgl3[0],tgl3[1],0);
            //alert(reachZeroOn);

            $('#defaultCountdown').countdown({
                alert("boo");
                until: reachZeroOn,
                compact: true, 
                onExpiry: end,
            });

        },
        error: function(ts){
            alert("error");
        }
    }); 

});

function end() { 
    $.ajax({
        url: host+'/skripsi3/phpmobile/canceltanpaseleksi.php',
        data: { "idacara":getacara,"idtenant":user,"nomor":nomor},
        dataType: 'json',
        success: function(data){
            alert("Pemesanan dibatalkan karena tidak melakukan pembayaran");
            window.location="home.html";
        },
        error: function(ts){
            alert(ts.responseText);
        }
    }); 
}
Rei
  • 143
  • 1
  • 11

0 Answers0