Created
December 31, 2015 22:58
-
-
Save edinsoncs/7885317cbc1004b00ca5 to your computer and use it in GitHub Desktop.
api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function(){ | |
| var xhr = new XMLHttpRequest; | |
| var API = "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch"; | |
| var SEARCH = prompt("Que vas a buscar?"); | |
| xhr.onreadystatechange = function(){ | |
| if (xhr.readyState == 4 && xhr.status == 200) { | |
| JSON.parse(xhr.responseText); | |
| } | |
| } | |
| xhr.open('GET', API + SEARCH); | |
| xhr.send(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment