Wes Gamble
2006-Nov-17 17:35 UTC
Overriding default try/catch in Prototype Ajax.Request call
Does anyone know if there is a way to indicate to Prototype that the Ajax.Request call should not be surrounded in a Javascript try/catch block? I have an Ajax.Request that opens up a popup and puts content into it. I''d like nothing to happen if the user closes the popup before the response comes back. Here''s the Prototype generated code for my Ajax.Request: try { popup.location.href = "/artisan_qualifiers/render_pdf?filename=C%3A%2Feclipse%2Fworkspace%2FOnlineRating%2Fconfig%2F..%2Fforms%2F4277_quote.pdf"; } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''popup.location.href = \"/artisan_qualifiers/render_pdf?filename=C%3A%2Feclipse%2Fworkspace%2FOnlineRating%2Fconfig%2F..%2Fforms%2F4277_quote.pdf\";''); throw e } FF2.0 doesn''t show anything in the browser if the popup is closed before the response comes back. IE displays the alerts shown in the catch block. I tried surrounding the popup.location.href= statement with "if (popup)..." but that didn''t work. Thanks, Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Have you tried AjaxSpy 7, or firebug? google ''debug rjs'' .... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---