Skip to content

Instantly share code, notes, and snippets.

@kkasaei
Created June 10, 2016 01:11
Show Gist options
  • Save kkasaei/f1915042523e03f299e62786557b3e27 to your computer and use it in GitHub Desktop.
Save kkasaei/f1915042523e03f299e62786557b3e27 to your computer and use it in GitHub Desktop.
JQuery Promise Example
function searchWikipedia (term) {
return $.ajax({
url: 'https://en.wikipedia.org/w/api.php',
dataType: 'jsonp',
data: {
action: 'opensearch',
format: 'json',
search: term
}
}).promise();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment