rschoenbach-YsT7sWjFhjxkMIhqc3i+4g@public.gmane.org
2007-May-10 16:36 UTC
Reversing Prototype Updater Effects
<script type="text/javascript" language="JavaScript"> function checkZip() { var url = ''check.php''; var params = ''zip='' + $F(''zip''); var ajax = new Ajax.Updater( {success: ''zipResult''}, url, {method: ''get'', parameters: params, onFailure: reportError}); } function reportError(request) { $F(''zipResult'') = "Error"; } </script> Attached is my script. It updates my container perfectly, but I am having a problem. I would like to add some functionality. I want this container to either disappear after 5 seconds or go back to <div id="zipResult"></ div> after 5 seconds. Any suggestions? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
at the end of your result function add: x = setTimeout("Element.hide(''zipResult'')",5000) On May 10, 12:36 pm, "rschoenb...-YsT7sWjFhjxkMIhqc3i+4g@public.gmane.org" <rschoenb...-YsT7sWjFhjxkMIhqc3i+4g@public.gmane.org> wrote:> <script type="text/javascript" language="JavaScript"> > function checkZip() { > var url = ''check.php''; > var params = ''zip='' + $F(''zip''); > var ajax = new Ajax.Updater( > {success: ''zipResult''}, > url, > {method: ''get'', parameters: params, onFailure: reportError});} > > function reportError(request) { > $F(''zipResult'') = "Error";} > > </script> > > Attached is my script. It updates my container perfectly, but I am > having a problem. > > I would like to add some functionality. I want this container to > either disappear after 5 seconds or go back to <div id="zipResult"></ > div> after 5 seconds. > > Any suggestions?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---