function updateCalendar(today, id){
new Ajax.Updater("calendars", "calendar.inc.php",
{asynchronous: true,
onCreate: function(){ showBusy },
onComplete: function(){ hideBusy },
method: "get",
parameters: "today=" + today +"&hotel_id=" +
"<?=$_SESSION[hotel_id]?>"
});
}
It doesn't take long to pull a request. Maybe the hide event occurs before
the show event has a chance to display? Did you try to breakpoint (or
alert();) these handlers ?
If you want to show an activity icon, there's also a "global" way of doing
this:
// Show Ajax progress indicator
var myGlobalHandlers = {
onCreate: function() {
$('ajaxworking').style.visibility = 'visible';
},
onComplete: function() {
$('ajaxworking').style.visibility = 'hidden';
}
};
Ajax.Responders.register(myGlobalHandlers); // Register
the handlers for content update
And if you need a spinner...
http://www.napyfab.com/ajax-indicators/
The only comment I have on the code you've written, is sometimes I need to
.bind(this) to the event handlers: e.g., OnComplete: showBusy()... Oops,
there's the problem. You didn't include parens to invoke your handler.
Sam
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs