mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
add post and get overloads for JQueryAjaxSettings. add tests for each of the items
This commit is contained in:
@@ -2528,6 +2528,18 @@ function test_jQuery() {
|
||||
$.post('url.xml', function (data) {
|
||||
var $child = $(data).find('child');
|
||||
});
|
||||
$.post({
|
||||
url: "test.php",
|
||||
success : () => {
|
||||
console.log("successfull");
|
||||
}
|
||||
});
|
||||
$.get({
|
||||
url: "test.php",
|
||||
success : () => {
|
||||
console.log("successfull");
|
||||
}
|
||||
});
|
||||
var foo = { foo: 'bar', hello: 'world' };
|
||||
var $foo = $(foo);
|
||||
var test1 = $foo.prop('foo');
|
||||
|
||||
13
jquery/jquery.d.ts
vendored
13
jquery/jquery.d.ts
vendored
@@ -676,6 +676,12 @@ interface JQueryStatic {
|
||||
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
|
||||
*/
|
||||
get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
||||
/**
|
||||
* Load data from the server using a HTTP GET request.
|
||||
*
|
||||
* @param settings The JQueryAjaxSettings to be used for the request
|
||||
*/
|
||||
get(settings : JQueryAjaxSettings): JQueryXHR;
|
||||
/**
|
||||
* Load JSON-encoded data from the server using a GET HTTP request.
|
||||
*
|
||||
@@ -721,7 +727,12 @@ interface JQueryStatic {
|
||||
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
|
||||
*/
|
||||
post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
||||
|
||||
/**
|
||||
* Load data from the server using a HTTP POST request.
|
||||
*
|
||||
* @param settings The JQueryAjaxSettings to be used for the request
|
||||
*/
|
||||
post(settings : JQueryAjaxSettings): JQueryXHR;
|
||||
/**
|
||||
* A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user