The page you linked to doesn't work... I'm still having issues with this
-- and having to rely on setTimeout -- even though it's bound.
Here's the updated code: -- notice setTimeout(pb.stopper,300); --
[BEGIN]
var pb = {
init: function() {
this.percent = 0;
this.updater = new Ajax.PeriodicalUpdater(
'ajaxUpdate',
'ajax_status.php',
{
frequency: 5,
onSuccess: this.update.bind(this)
}
);
pb.nextUpdate = 5;
pb.updateTimer();
},
update: function(resp, json) {
$('pbBarTextPercent').innerHTML = json.sent;
$('pbText').innerHTML = json.percent + "%";
$('pbBar').setStyle({width: json.percent + '%' });
if (json.status == 'finished') {
this.updater.stop();
setTimeout(pb.stopper,300);
}
.............
},
stopper: function() {
pb.updater.stop();
},
updateTimer: function() {
if (pb.nextUpdate > 0) {
pb.nextUpdate = pb.nextUpdate - 1;
$('updateTime').innerHTML = pb.nextUpdate;
}
setTimeout(pb.updateTimer,1000);
}
}
/* INIT FUNCTIONS */
pb.init();
[END]
Ed C. wrote:
I think correct URL is:
http://blog.jagregory.com/articles/2006/01/09/801.aspx
On 5/2/06, *Maninder, Singh* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Prototype PeriodicalExecuter.stop()
http://blog.jagregory.com/Blog/archive/2006/01/09/801.aspx
Thanks,
Mandy.
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
<mailto:Rails-spinoffs@lists.rubyonrails.org>
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
------------------------------------------------------------------------
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs