Skip to content

Commit d7d495a

Browse files
committed
ajax docs
1 parent 78e5641 commit d7d495a

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

ajax.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,14 @@ var param = require("../../js/param/param");
2828
* });
2929
* ```
3030
*
31-
* @param {can-util/typedefs/ajaxOptions} ajaxOptions Configuration options for the AJAX request.
32-
* - __url__ {String} The requested url.
33-
* - __type__ {String} The method of the request. Ex: `GET`, `PUT`, `POST`, etc. Capitalization is ignored. Default is `GET`.
34-
* - __data__ {Object} The data of the request. If data needs to be urlencoded (e.g. for GET requests or for CORS) it is serialized with [can-util/js/param].
35-
* - __dataType__ {String} Type of data. Default is `json`.
36-
* - __crossDomain__ {Boolean} If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. Default: `false` for same-domain requests, `true` for cross-domain requests.
37-
* - __timeout__ {Number} Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout.
38-
* - __timeoutFn__ {Function} Timeout callback to be called after `xhr.abort()`.
39-
* - __success__ {Function} A function to be called if the request succeeds. The function gets passed one argument based on content type: `xhr.responseText`, `xhr.responseXML` or parsed JSON.
40-
* - __error__ {Function} A function to be called if the request fails. The function receives three arguments: `xhr`, `xhr.status` and `xhr.statusText`.
41-
* - __complete__ {Function} A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: `xhr`, `xhr.statusText`.
42-
* - __userAgent__ {String} Default: `XMLHttpRequest`.
43-
* - __lang__ {String} Default `en`.
31+
* @param {Object} ajaxOptions Configuration options for the AJAX request.
32+
* - __url__ `{String}` The requested url.
33+
* - __type__ `{String}` The method of the request. Ex: `GET`, `PUT`, `POST`, etc. Capitalization is ignored. _Default is `GET`_.
34+
* - __data__ `{Object}` The data of the request. If data needs to be urlencoded (e.g. for GET requests or for CORS) it is serialized with [can-util/js/param].
35+
* - __dataType__ `{String}` Type of data. _Default is `json`_.
36+
* - __crossDomain__ `{Boolean}` If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. Default: `false` for same-domain requests, `true` for cross-domain requests.
37+
* - __userAgent__ `{String}` _Default: `XMLHttpRequest`_.
38+
* - __lang__ `{String}` _Default `en`_.
4439
*
4540
* @return {Promise} A Promise that resolves to the data. The Promise instance is abortable and exposes an `abort` method. Invoking abort on the Promise instance indirectly rejects it.
4641
*

0 commit comments

Comments
 (0)