this is my jquery countdown code when click event is trigger on id dlbtn
var settimmer = 0;
$(function() {
$('#dlbtn').click(function() {
$('#dlnotify').toggle('slow');
window.setInterval(function() {
var timeCounter = $("b[id=show-time]").html();
var updateTime = eval(timeCounter) - eval(1);
$("b[id=show-time]").html(updateTime);
if (updateTime <= 0) {
window.location = ('/dl.php?fid=12');
$('#dlnotify').hide();
}
}, 500);
updateTime--;
return false; //Kill the Event after request
});
});
my script keep on hitting dl.ph page
I’m not 100% sure what the issue is however in order to remove the
setIntervalyou need to make a call toclearIntervalhttp://www.w3schools.com/jsref/met_win_setinterval.asp
Try this code: