I just checked in some more changes to the form plugin. The methods
were reworked to use the standard plugin style for specifying options.
The signatures for ajaxSubmit and ajaxForm now take just a single
argument which is an object literal. Here are the details from the
docs:
-----------------
The following options are supported:
target: Identifies the element(s) in the page to be updated with the
server response.
This value may be specified as a jQuery selection string, a
jQuery object,
or a DOM element.
default value: null
url: URL to which the form data will be submitted.
default value: value of form's 'action' attribute
method: The method in which the form data should be submitted, 'GET'
or 'POST'.
default value: value of form's 'method' attribute (or 'GET'
if none found)
before: Callback method to be invoked before the form is submitted.
default value: null
after: Callback method to be invoked after the form has been
successfully submitted.
default value: null
dataType: Expected dataType of the response. One of: null, 'xml',
'script', or 'json'
default value: null
semantic: Boolean flag indicating whether data must be submitted in
semantic order
default value: false
...
The dataType option provides a means for specifying how the server
response should be handled. This maps directly to the jQuery.httpData
method so the following values are supported:
'xml': if dataType == 'xml' the server response is treated as XML
and the 'after'
callback method will be passed the responseXML value
'json': if dataType == 'json' the server response will be
evaluated and passed to
the 'after' callback
'script': if dataType == 'script' the server response is evaluated
in the global context
-----------------
I've updated the example page and unit tests to reflect these updates:
http://malsup.com/jquery/form/Note: Like the previous update, this version of form.js requires
jQuery 1.02 or later.
Cheers.
Mike
_______________________________________________
jQuery mailing list
discuss@jquery.comhttp://jquery.com/discuss/