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 added .DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions Fetch-GitHub-User-And-Search-Opration/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function search () {
var name = document.getElementById("name").value;

$.getJSON("https://api.github.com/users/"+name, function(result){
console.log(result);

$('#fullname').html(result.name);
$('#dp').attr("src",result.avatar_url);
$('#followers').html("followers : "+result.followers);
$('#following').html("following : "+result.following);
$('#created_at').html("created_at : "+result.created_at);

}).fail(function() {
$('#fullname,#dp,#followers,#following,#created_at').hide();
// $('#dp ').hide();
$('#msg').html('This Username is not available');

})
}
26 changes: 26 additions & 0 deletions Fetch-GitHub-User-And-Search-Opration/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>

<form>
<input type="text" name="name" id="name">
<button type="button" onclick="search()">Search</button>
</form>

<div>
<h1 id="fullname"></h1>
<img width="200" height="200" id="dp">
<p id="location"></p>
<p id="followers"></p>
<p id="following"></p>
<p id="created_at"></p>
<h1 id="msg"></h1>
</div>

</body>
</html>