Skip to content

Instantly share code, notes, and snippets.

@ndunk28
Created September 15, 2017 15:08
Show Gist options
  • Save ndunk28/2ccf1d701a9b7c0f00cac61813670b34 to your computer and use it in GitHub Desktop.
Save ndunk28/2ccf1d701a9b7c0f00cac61813670b34 to your computer and use it in GitHub Desktop.
Simple ajax data
$.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