Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Get demo</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<form id="userForm">
<input id ="username" type="text" name="username" placeholder="Enter gitHub User name">
<input type="button" id="submit" value="Search" onclick="nextStep1()">
</form>
<!-- the result of the search will be rendered inside this div -->
<div id="result"></div>
<script>
// Attach a submit handler to the form
function nextStep1() {
var username = document.getElementById("username").value;
var url = "https://api.github.com/users/"+username+"/repos";
// Send the data using post
req=new XMLHttpRequest();
req.open("GET",'url',true);
req.send();
req.onload=function(){
json=JSON.parse(req.responseText);
document.getElementsByClassName('message')[0].innerHTML=JSON.stringify(json);
};
}
</script>
</body>
</html>
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more