Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Aly_Hemani/.DS_Store
Binary file not shown.
Binary file added Aly_Hemani/AJAX API/.DS_Store
Binary file not shown.
Binary file added Aly_Hemani/AJAX API/Pokedex/.DS_Store
Binary file not shown.
10,220 changes: 10,220 additions & 0 deletions Aly_Hemani/AJAX API/Pokedex/jquery-3.1.1.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions Aly_Hemani/AJAX API/Pokedex/pokedex.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#webber{
width:970px;
height:auto;
overflow:hidden;
background-color:grey;
}
#left{
width:600px;
display:inline-block;
}
#right{
width:360px;
height:440px;
display:inline-block;
background-color:red;
vertical-align:top;
}
#white{
background-color:white;
width:330px;
height:420px;
margin:10px 0px 0px 10px;
padding-left:10px;
}
20 changes: 20 additions & 0 deletions Aly_Hemani/AJAX API/Pokedex/pokedex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Pokedex</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="pokedex.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="pokedex.js"></script>
</head>
<body>
<div id="webber">
<h1>Pokedex</h1>
<div id="left"></div>
<div id="right">
<div id="white">
</div>
</div>
</div>
</body>
</html>
29 changes: 29 additions & 0 deletions Aly_Hemani/AJAX API/Pokedex/pokedex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$(document).ready(function(){

for(i=1; i<152; i++){
var img =('<img id="'+i+'" src="http://pokeapi.co/media/img/'+i+'.png">');
$('#left').append(img);
}

$('img').click(function(){
var id=$(this).attr('id');
$.get("http://pokeapi.co/api/v1/pokemon/"+id, function(res) {
console.log(res);
var information = '<h4>'+res.name+'</h4>';
information += '<img src="http://pokeapi.co/media/img/'+id+'.png">';
information += '<h6>Types</h6>';
information += '<p>'+res.types[0].name+'<p>';
information += '<h6>Height</h6>';
information += res.height;
information += '<h6>Weight</h6>';
information += res.weight;
$('#white').html(information);




}, "json");
});


});
Loading