Show Dish Name
Use API Call to show the names on the UI
by Ajay Dubey
HTML
<!DOCTYPE html>
<html lang='eng'>
<head>
<title>Dishes!</title>
<!-- Use Api : https://ajaydubey.herokuapp.com/categories.json-->
</head>
<body>
Ajay is Testing API response
</body>
<script>
const url = 'https://ajay-todo-node.herokuapp.com/todos';
const http = new XMLHttpRequest();
http.open('get', url);
http.send();
http.onreadystatechange = function() {
if(this.status == 200) {
console.log(JSON.parse(http.responseText));
}
}
/* fetch(url)
.then(function(response){
const k = response.json();
console.log(k);
// console.log(response.ok);
}, function(err){
console.log('complete');
}) */
</script>
<!-- 123 ->