javascript - Countdown finished -


i have serious problem resolve countdown timer in php. use keith-wood countdown plugin , works following:

when countdown timer end, update data database.

 <input class='data<?php echo $id ?>' type='hidden'  value=<?php echo $data; ?> /><br/>  <span style='font-size: 15px; font-weight: bold; margin-left:38px;'>este voucher termina</span><br/><br/>  <div id='defaultcountdown' class='endtime<?php echo $id ?>'></div> 

my code start countdown timer is

$(function () { var = <?php echo $id ?>; var dataval = $('.data' + i.tostring()).val(); var data = new date(dataval); str = '.endtime'+i.tostring(); $(str).countdown({until: data, format: 'dhms'});  }); 

my problem how check when timer over.

the plugin provides 'onexpiry' callback. example:

$(str).countdown({   until: data,   format: 'dhms',   onexpiry: function() {     console.log("timer done!");   } }); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -