Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added files
  • Loading branch information
mohamedmehdigara committed May 9, 2021
commit 6eea3aaa25bf6cc8c3a02a87bc94e2759a79319a
23 changes: 23 additions & 0 deletions Week1/homework/js-exercises/Exercise2/getRandomUser2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const Http = new XMLHttpRequest();

const url = 'https://xkcd.now.sh/?comic=latest';
Http.open('GET', url);
Http.send();

const axios = require('axios').default;

axios
.get('https://xkcd.now.sh/?comic=latest')
.then((resp) => {
console.log(resp.data);
})
.catch((err) => {
// Handle Error Here
console.error(err);
});
const image = document.createElement('img');
var x = document.getElementById('img');

Http.onreadystatechange = (e) => {
console.log(Http.responseText);
};