jquery-counter icon indicating copy to clipboard operation
jquery-counter copied to clipboard

problem using the play function

Open kchiang opened this issue 12 years ago • 0 comments
trafficstars

Getting a undefined object error when using ajax to update the counter variables and "replaying" the counter.

&ltspan class="total_stats counter counter-analog" data-direction="up" data-format="999,999" datastop="150,000" data-interval="1"&gt145,000&lt/span&gt &ltscript&gt $('.counter').counter({}); $('.counter').on('counterStop',function() { $.ajax( { url: 'get_counter_stats.php', cache:false,success:function(html){ $('.counter').replaceWith(html);} }).done(function() { $('.counter').counter('play'); }); }); &lt/script&gt

Here's the error: play: function() { return this.each(function() { var e = $(this); var data = e.data('counter'); if (!data.intervalId) {

UNCAUGHT type error: cannot read property 'intervalId' of undefined

var data in this case is undefined.

kchiang avatar Dec 31 '12 10:12 kchiang