-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
17 lines (17 loc) · 696 Bytes
/
index.js
File metadata and controls
17 lines (17 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$.ajax({
type: 'get',
url: 'https://www.themealdb.com/api/json/v1/1/filter.php?a=Italian',
success: function(response){
for(var i=0; i<response.meals.length; i++){
var newItem = `<div class="col-3 my-3 mx-4 shadow-lg bg-body rounded">
<h5 class="font-weight-bold my-2 text-center"> ${response.meals[i].strMeal} </h5>
<img src = "${response.meals[i].strMealThumb}" class="img-fluid text-center" />
<p class="my-2 text-end">Dish ID - ${response.meals[i].idMeal}</p>
</div>`
$('#myitems').append(newItem);
}
},
error: function(error){
console.log(error);
}
})