2009年2月14日 星期六

jquery ajax

pecifying the Data Type for AJAX Requests
Ajax Event
jquery ajax api

注意一下的參數
cache
Added in jQuery 1.2, if set to false it will force the pages that you request to not be cached by the browser.

complete

A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The XMLHttpRequest object and a string describing the type of success of the request.



contentType
When sending data to the server, use this content-type. Default is "application/x-www-form-urlencoded", which is fine for most cases.

data
Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key i.e. {foo:["bar1", "bar2"]} becomes '&foo=bar1&foo=bar2'.

processData
By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send DOMDocuments, or other non-processed data, set this option to false.

password
A password to be used in response to an HTTP access authentication request.

username
A username to be used in response to an HTTP access authentication request.

沒有留言: