add post and get overloads for JQueryAjaxSettings. add tests for each of the items

This commit is contained in:
Jason Gallavin
2016-04-17 17:32:36 -04:00
parent 544a35a108
commit 4cdfbe96b6
2 changed files with 24 additions and 1 deletions

View File

@@ -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
View File

@@ -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.
*