Skip to content

Commit

Permalink
[jquery] Add jQuery.getScript(options).
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard-thieu committed Oct 8, 2018
1 parent ea00476 commit 78fb12a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions types/jquery/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,14 @@ $.getScript( url, function() {
*/
getScript(url: string,
success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>;
/**
* Load a JavaScript file from the server using a GET HTTP request, then execute it.
*
* @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
* @since 1.12
* @since 2.2
*/
getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR<string | undefined>;
/**
* Execute some JavaScript code globally.
*
Expand Down
5 changes: 5 additions & 0 deletions types/jquery/jquery-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ function JQueryStatic() {
// $ExpectType jqXHR<string | undefined>
jqXHR;
});

// $ExpectType jqXHR<string | undefined>
$.getScript({
url: 'url',
});
}

function globalEval() {
Expand Down

0 comments on commit 78fb12a

Please sign in to comment.