...
onCreate: function(){showBusy();},
onComplete: function(){hideBusy()},
...
but I would think that you should just be able to omit the anonymous function all-together like so:
...
onCreate: showBusy,
onComplete: hideBusy,
...
When you do this you don't want the () as you are just passing the name instead of calling the function as with the anonymous function.
Brandon
On 6/26/06, Owen Franssen <[EMAIL PROTECTED]> wrote:
I've been trying to use the prototype.js Ajax obect's event handlers (onCreate, onComplete) inside the options tags as
below:
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]?>"
});
}
function showBusy(){
new Effect.Appear('busy',{duration:0.5,queue:'end'});
}
function hideBusy(){
new Effect.Fade('busy',{duration:0.5,queue:'end'});
}
No matter how I try however these event handlers do not work. Any suggestions as to what I am doing wrong? I am using
prototype 1.5.0_rc0 btw.
Regards,
Owen
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
