HTML Get Json jquery javascript örneği

Paylaş.

<!DOCTYPE html>
<html>
<head>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$.getJSON(“http://www.w3schools.com/angular/customers.php”, function(data){

//alert(data);

$.each( data.records, function( i, item ) {
adi = item.Name;
// alert(adi);
$(“div”).append(adi);
});

//var adi = data.records[0].Name ;

}); // get json

}); // button

}); // document
</script>
</head>
<body>

<button>Get JSON data</button>
<span></span>
<div></div>
</body>
</html>

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)