Open mianzaid opened 7 years ago
success: function(data){ var a = data.split('|**|'); if(a[1]==2 || parseInt(a[1])==2){ var newTime = new Date(a[0]); var cHour = newTime.getHours(); var cMin = newTime.getMinutes(); var cSec = newTime.getSeconds(); var MyTime = cHour+ ":" + cMin+ ":" +cSec; var month = newTime.getMonth()+1; var day = newTime.getDate(); var output = newTime.getFullYear() + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
$("#reload_1").countdown(output+' '+MyTime).on('update.countdown', function(event) { var format = '%H:%M:%S'; $(this).html(event.strftime); }); }
}
How can i trigger countdown function on success @hilios
I am trying to prepare date by using ajax and pass this date to countdown function but nothing happen. Below is the ajax success code
success: function(data){ var a = data.split('|**|'); if(a[1]==2 || parseInt(a[1])==2){ var newTime = new Date(a[0]); var cHour = newTime.getHours(); var cMin = newTime.getMinutes(); var cSec = newTime.getSeconds(); var MyTime = cHour+ ":" + cMin+ ":" +cSec;
var month = newTime.getMonth()+1; var day = newTime.getDate(); var output = newTime.getFullYear() + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
}
How can i trigger countdown function on success @hilios