// an empty object with xmldocs for assistance in creating ajax settings
var ajaxSettings = function() {
/// <summary>A set of key/value pairs that configure the Ajax request. All options are optional.
/// A default can be set for any option with $.ajaxSetup().</summary>
/// <field name="async" type="Boolean">Default: true
/// By default, all requests are sent asynchronous (i.e. this is set to true by default). If you
/// need synchronous requests, set this option to false. Note that synchronous requests may temporarily
/// lock the browser, disabling any actions while the request is active.</field>
/// <field name="beforeSend" type="Function">Function(XMLHttpRequest)
/// A pre-callback to modify the XMLHttpRequest object before it is sent. Use this to set custom headers
/// etc. The XMLHttpRequest is passed as the only argument. This is an Ajax Event. You may return false
/// in function to cancel the request.</field>
/// <field name="cache" type="Boolean">Default: true, false for dataType 'script' and 'jsonp'
/// If set to false it will force the pages that you request to not be cached by the browser.</field>
/// <field name="complete" type="Function">Function(XMLHttpRequest, textStatus)
/// 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 status
/// of the request. This is an Ajax Event.</field>
/// <field name="contentType" type="String">Default: 'application/x-www-form-urlencoded'
/// When sending data to the server, use this content-type. Default is "application/x-www-form-urlencoded",
/// which is fine for most cases. If you explicitly pass in a content-type to $.ajax() then it'll always
/// be sent to the server (even if no data is sent).</field>
/// <field name="context" type="Object">This object will be made the context of all Ajax-related callbacks.
/// For example specifying a DOM element as the context will make that the context for the complete callback
/// of a request, like so:
/// $.ajax({ url: "test.html", context: document.body, success: function(){ $(this).addClass("done"); }});</field>
/// <field name="data" type="Object">Object, String.
/// 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'.</field>
/// <field name="dataFilter" type="Function">Function(data, type) A function to be used to handle the raw
/// responsed data of XMLHttpRequest.This is a pre-filtering function to sanitize the response.You should return
/// the sanitized data.The function gets passed two arguments: The raw data returned from the server, and the
/// 'dataType' parameter.</field>
/// <field name="dataType" type="String">Default: Intelligent Guess (xml, json, script, or html)
/// The type of data that you're expecting back from the server. If none is specified, jQuery will intelligently
/// try to get the results, based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON
/// will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as
/// a string). The available types (and the result passed as the first argument to your success callback) are:
///
/// * "xml": Returns a XML document that can be processed via jQuery.
/// * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
/// * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching unless option
/// "cache" is used. Note: This will turn POSTs into GETs for remote-domain requests.
/// * "json": Evaluates the response as JSON and returns a JavaScript object. In jQuery 1.4 the JSON parsing is
/// done in a strict manner, any malformed JSON is rejected and a parsererror is thrown.
/// * "jsonp": Loads in a JSON block using JSONP. Will add an extra "?callback=?" to the end of your URL to specify
/// the callback.
/// * "text": A plain text string.
/// </field>
/// <field name="error" type="Function">Function(XMLHttpRequest, textStatus, errorThrown)
/// A function to be called if the request fails. The function is passed three arguments: The XMLHttpRequest object,
/// a string describing the type of error that occurred and an optional exception object, if one occurred. Possible
/// values for the second argument (besides null) are "timeout", "error", "notmodified" and "parsererror".
/// This is an Ajax Event.</field>
/// <field name="global" type="Boolean">Default: true
/// Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the
/// global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.</field>
/// <field name="ifModified" type="Boolean">Default: false
/// Allow the request to be successful only if the response has changed since the last request. This is done by checking the
/// Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag'
/// specified by the server to catch unmodified data.</field>
/// <field name="jsonp" type="String">Override the callback function name in a jsonp request. This value will be used instead
/// of 'callback' in the 'callback=?' part of the query string in the url for a GET or the data for a POST.
/// So {jsonp:'onJsonPLoad'} would result in 'onJsonPLoad=?' passed to the server.</field>
/// <field name="jsonp" type="CallbackString">Specify the callback function name for a jsonp request. This value will be used
/// instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as
/// it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback
/// when you want to enable better browser caching of GET requests.</field>
/// <field name="password" type="String">A password to be used in response to an HTTP access authentication request.</field>
/// <field name="processData" type="Boolean">Default: true
/// 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 a DOMDocument, or other non-processed data, set this option to false.</field>
/// <field name="scriptCharset" type="String">Only for requests with "jsonp" or "script" dataType and "GET" type. Forces the
/// request to be interpreted as a certain charset. Only needed for charset differences between the remote and local content.</field>
/// <field name="success" type="Function">Function(data, textStatus, XMLHttpRequest)
/// A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server,
/// formatted according to the 'dataType' parameter; a string describing the status; and the XMLHttpRequest object (available as
/// of jQuery 1.4). This is an Ajax Event.</field>
/// <field name="timeout" type="Number">Set a local timeout (in milliseconds) for the request. This will override the global timeout,
/// if one is set via $.ajaxSetup. For example, you could use this property to give a single request a longer timeout than all other
/// requests that you've set to time out in one second. See $.ajaxSetup() for global timeouts.</field>
/// <field name="traditional" type="Boolean">Set this to true if you wish to use the traditional style of param serialization.</field>
/// <field name="type" type="String">Default: 'GET'
/// The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can
/// also be used here, but they are not supported by all browsers.</field>
/// <field name="url" type="String">Default: The current page
/// A string containing the URL to which the request is sent.</field>
/// <field name="username" type="String">A username to be used in response to an HTTP access authentication request.</field>
/// <field name="xhr" type="Function">Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE),
/// the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.</field>
}
Updated 03/25/10: fixed an escape issue in .data that caused intellisense to fail.
NOTE: use the 'view plain text' icon (<>) to get the script. If you copy from this post you will find that '&' are not encoded properly.
Technorati tags:
jQuery,
Visual Studio,
Intellisense,
JavaScript