diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-11 06:44:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-11 06:44:10 +0000 |
commit | 216b0e0fbab310d374d2a43fe774839ac8ce6cdb (patch) | |
tree | ee3d8a50bc01b02358a59f3ff155a0ee140e615e /actionpack/lib/action_view/helpers | |
parent | 5b9b904f149f8ae41255096ba7b210c912329103 (diff) | |
download | rails-216b0e0fbab310d374d2a43fe774839ac8ce6cdb.tar.gz rails-216b0e0fbab310d374d2a43fe774839ac8ce6cdb.tar.bz2 rails-216b0e0fbab310d374d2a43fe774839ac8ce6cdb.zip |
Improved documentation for :success/:failure callbacks #1699 [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 7034b95000..0c22996e02 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -72,7 +72,7 @@ module ActionView # :url => { :action => "undo", :n => word_counter }, # :complete => "undoRequestCompleted(request)" # - # The callbacks that may be specified are: + # The callbacks that may be specified are (in order): # # <tt>:loading</tt>:: Called when the remote document is being # loaded with data by the browser. @@ -81,13 +81,15 @@ module ActionView # <tt>:interactive</tt>:: Called when the user can interact with the # remote document, even though it has not # finished loading. - # <tt>:complete</tt>:: Called when the XMLHttpRequest is complete, - # and the HTTP status code is 200 OK. - # <tt>:failure</tt>:: Called when the XMLHttpRequest is complete, - # and the HTTP status code is anything other than - # 200 OK. - # - # You can further refine <tt>:failure</tt> by adding additional + # <tt>:success</tt>:: Called when the XMLHttpRequest is completed, + # and the HTTP status code is in the 2XX range. + # <tt>:failure</tt>:: Called when the XMLHttpRequest is completed, + # and the HTTP status code is not in the 2XX + # range. + # <tt>:complete</tt>:: Called when the XMLHttpRequest is complete + # (fires after success/failure if they are present)., + # + # You can further refine <tt>:success</tt> and <tt>:failure</tt> by adding additional # callbacks for specific status codes: # # Example: @@ -96,6 +98,7 @@ module ActionView # 404 => "alert('Not found...? Wrong URL...?')", # :failure => "alert('HTTP Error ' + request.status + '!')" # + # A status code callback overrides the success/failure handlers if present. # # If you for some reason or another need synchronous processing (that'll # block the browser while the request is happening), you can specify |