I belive you will want to add the () to the showBusy and hideBusy call like so:<br>...<br>onCreate: function(){showBusy();},<br>onComplete: function(){hideBusy()},<br>...<br><br>but I would think that you should just be able to omit the anonymous function all-together like so:
<br>...<br>onCreate: showBusy,<br>onComplete: hideBusy,<br>...<br>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.<br><br>Brandon<br><br>
<div><span class="gmail_quote">On 6/26/06, <b class="gmail_sendername">Owen Franssen</b> <<a href="mailto:owen@twisted-design.net">owen@twisted-design.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've been trying to use the prototype.js Ajax obect's event handlers (onCreate, onComplete) inside the options tags as<br>below:<br><br>function updateCalendar(today, id){<br> new Ajax.Updater("calendars", "
calendar.inc.php",<br> {asynchronous: true,<br> onCreate: function(){ showBusy },<br> onComplete: function(){ hideBusy },<br> method: "get",<br> parameters: "today=" + today +"&hotel_id=" + "<?=$_SESSION[hotel_id]?>"
<br> });<br>}<br><br>function showBusy(){<br> new Effect.Appear('busy',{duration:0.5,queue:'end'});<br>}<br><br>function hideBusy(){<br> new Effect.Fade('busy',{duration:0.5,queue:'end'});<br>}<br><br>No matter how I try however these event handlers do not work. Any suggestions as to what I am doing wrong? I am using
<br>prototype 1.5.0_rc0 btw.<br><br>Regards,<br>Owen<br><br><br>_______________________________________________<br>Rails-spinoffs mailing list<br><a href="mailto:Rails-spinoffs@lists.rubyonrails.org">Rails-spinoffs@lists.rubyonrails.org
</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs">http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs</a><br></blockquote></div><br>