I''m creating simple ajax request. but onCreate and onComplete doesn''t work. Are this methods deprecated in 1.6.0.2? onLoading and onLoaded also doesn''t work. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It''s really strange. This is my code: function topicAdd(){ var params = $(form).serialize(true); new Ajax.Request(''topic_add.php'', { parameters: params, onCreate: onLoading, onComplete: onLoaded, onSuccess: function(transport){ onSaved(transport); } }); } function onLoading(){ $(''btn_add'').disable(); $(''btn_add'').insert({ before: new Element(''img'', {id: ''loadIndicator'', src: ''/images/ indicator.gif''}) }); } function onLoaded(){ $(''loadIndicator'').remove(); $(''btn_add'').enable(); } If I disable button, insert doesn''t work. Is it bug, or some security reason? On Mar 26, 5:40 pm, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m creating simple ajax request. but onCreate and onComplete doesn''t > work. Are this methods deprecated in 1.6.0.2? onLoading and onLoaded > also doesn''t work.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m sorry. That was my fault. There was used <button> instead of <input type="button">, so $(button).enable() / $(button).disable() throw "undefined function" exception. On Mar 26, 6:04 pm, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It''s really strange. This is my code: > > function topicAdd(){ > var params = $(form).serialize(true); > new Ajax.Request(''topic_add.php'', { > parameters: params, > onCreate: onLoading, > onComplete: onLoaded, > onSuccess: function(transport){ > onSaved(transport); > } > }); > > } > > function onLoading(){ > $(''btn_add'').disable(); > $(''btn_add'').insert({ > before: new Element(''img'', {id: ''loadIndicator'', src: ''/images/ > indicator.gif''}) > }); > > } > > function onLoaded(){ > $(''loadIndicator'').remove(); > $(''btn_add'').enable(); > > } > > If I disable button, insert doesn''t work. Is it bug, or some security > reason? > > On Mar 26, 5:40 pm, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m creating simple ajax request. but onCreate and onComplete doesn''t > > work. Are this methods deprecated in 1.6.0.2? onLoading and onLoaded > > also doesn''t work. > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---