When the AJAX function is loaded on the page, I am attempting to execute another function.
The code snippet for the AJAX call:
$.ajax({
type: "POST",
url: "loginpersonal.asp",
data: "id=<%=request("id")%>",
beforeSend: function() {
$("#personaltab").hide();
},
success: function(msg){
$("#personaltab").empty().append(msg);
},
complete: function() {
$("#personaltab").slideDown();
},
error: function() {
$("#personaltab").append("error").slideDown();
}
});
Below is the JavaScript function:
function GetCount(t){
if(t>0) {
total = t
}
else {
total -=1;
}
amount=total;
if(amount < 0){
startpersonalbid();
}
else{
days=0;hours=0;mins=0;secs=0;out="";
days=Math.floor(amount/86400);//days
amount=amount%86400;
hours=Math.floor(amount/3600);//hours
amount=amount%3600;
mins=Math.floor(amount/60);//minutes
amount=amount%60;
secs=Math.floor(amount);//seconds
if(days != 0){out += days +":";}
if(days != 0 || hours != 0){out += hours +":";}
if(days != 0 || hours != 0 || mins != 0){out += ((mins>=10)?mins:"0"+mins) +":";}
out += ((secs>=10)?secs:"0"+secs) ;
document.getElementById('countbox').innerHTML=out;
setTimeout("GetCount()", 1000);
}
}
window.onload=function(){
GetCount(<%= DateDiff("s", Now,privatesellstartdate&" "&privatesellstarttime ) %>);
Therefore, after the completion of the AJAX function in loginpersonal.asp, I aim to trigger the GetCount() function again.