Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Title</title>
- </head>
- <body>
- <script>
- var gists = [];
- function getGists(gists)
- {
- var request = new XMLHttpRequest();
- if(!request)
- {
- throw 'Unable to create HttpRequest.';
- }
- var url = 'https://api.github.com/gists/public';
- request.onreadystatechange = function()
- {
- if(this.readyState == 4)
- {
- console.log(this.responseText);
- gists = JSON.parse(this.reponseText); //missing ;?
- //console.log(this.reponseText);
- }
- };
- request.open('GET', url);
- request.send();
- }
- getGists(gists);
- //console.log(gists[0].user);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement