Created
September 15, 2017 15:08
-
-
Save ndunk28/2ccf1d701a9b7c0f00cac61813670b34 to your computer and use it in GitHub Desktop.
Simple ajax data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: 'GET', | |
dataType: 'json', | |
url: "example.html", | |
data: {table:"id"}, | |
beforeSend:function(a){ | |
$("body").append("<p>beforesend</p>"); | |
}, | |
success: function (data) { | |
$("ul").append("<p>alreadysend</p>"); | |
for(var x in data.data){ // looping data in variabel x | |
console.log(data.data[x]); // show each data | |
console.log(data.data[0]["id"]); // show only spesific data | |
} | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment