diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index ecd9266b45..a3a8e6581d 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -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'); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 51a2773bf2..6478529dad 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -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. *