Appendix G (^) ❘ 535
bapp07.indd 02/17/2015 Page 535
load(
url
[, data]
[,
onCompleteFunction]
)
Loads HTML from a remote fi le
and inserts the HTML inside of
the selected elements. The data
argument (optional) is specifi ed as
an object literal, defi ning the data
you want to pass to the server in
key, value pairs. The function
argument (also optional) is the
callback method that handles the
data when it is returned from the
server.
jQuery
$.param(object[,
traditional])
Creates a serialized representation
of an object or an array, which can
then be used in a URL or AJAX
request.
The optional traditional argu-
ment indicates whether serial-
ization should be a traditional
shallow serialization.
String
$.post(
url
[, data]
[, onSuccessFunction]
[, dataType]
)
Initiates and sends to the server
an HTTP POST request.
jQuery
XMLHttpRequest
serialize() Serializes a set of input elements
into a string of data.
String
serializeArray() Serializes all forms and form ele-
ments into a JSON structure.
Array
AJAX OPTIONS
Option Description Type
accepts The content type sent in the
request header to the server
that tells the server what kind of
response the browser can accept
in its response.
The default value depends on
dataType.
Object
continues
http://www.it-ebooks.info
elliott
(Elliott)
#1