I have a js function(timer to reload the webpage) running on a website and I want to know is there any way to access and modify variables in this function so that website can reload right now.
I tried to access variables using following in the console
window.secondsLeft=0
But nothing happened. If I tried to access any other variable I got undefined.
<script type="text/javascript">
var end_time = moment().add(265.96296960866664, 'minutes').toDate();
var totalSeconds = 15957.778176519998;
$('#clock').countdown(end_time).on('update.countdown', function(event) {
var format = '%D Days %H Hr : %M min : %S sec ';
var secondsLeft = (new Date(end_time).getTime() - parseInt(event.timeStamp))/(1000);
var percentage = 100 - (secondsLeft/parseFloat(totalSeconds))*100;
if (secondsLeft <= 60 && secondsLeft >= 59) {
toastr.info('Starting!.', 'Info', {timeOut: 5000});
}
else if (secondsLeft <= 0) {
toastr.clear();
}
$(this).html(event.strftime(format));
})
.on('finish.countdown', function(event) {
document.location.reload(true);
});
</script>
Is there any way to set secondsLeft = 0 ?