Wayne Larsen
2005-Jul-16 17:16 UTC
Safari Crash with prototype/success callback interaction
I just tracked down a problem I was having with Safari crashing. Given a form_remote_tag call, I was calling Element.hide on a block that was being returned via the ajax call, from the success event. ie form_remote_tag(:url=>..., :update=>''somediv'', :success=>"Element.hide(''somediv'');") where somediv was returned via the form. This causes Safari to crash when the form is submitted by the keyboard (pressing Return), but _NOT_ when the form is submitted via clicking on the submit button with the mouse. This happens with Safari from OSX 10.3.9, and edge rails. What I was trying to do does not work because the success (and failure) callbacks are being executed before the returned data is inserted. Why it crashes Safari in this manner is simply strange, however. This does lead me to wonder: should the success/failure callbacks not be executed after the returned data is inserted, similar to the complete callback? Regards, Wayne