Skip to content

Commit 215f89f

Browse files
committed
update docs for jqxhr
1 parent cfd9c57 commit 215f89f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ No special markup is needed, just a normal form. Submitting a form with AJAX do
99

1010
##API
1111

12+
###jqXHR
13+
The jqXHR object is stored in element <em>data</em>-cache with the <code>jqxhr</code> key after each <code>ajaxSubmit</code>
14+
call. It can be accessed like this:
15+
````javascript
16+
var form = $('#myForm').ajaxSubmit({ /* options */ });
17+
var xhr = form.data('jqxhr');
18+
19+
xhr.done(function() {
20+
...
21+
});
22+
````
23+
1224
###ajaxForm( options )
1325
Prepares a form to be submitted via AJAX by adding all of the necessary event listeners. It does **not** submit the form. Use `ajaxForm` in your document's `ready` function to prepare existing forms for AJAX submission, or with the `delegation` option to handle forms not yet added to the DOM.
1426
Use ajaxForm when you want the plugin to manage all the event binding for you.

0 commit comments

Comments
 (0)