Please enable JavaScript.
Coggle requires JavaScript to display documents.
AJAX (JSON (when (info, getting), pravo ([ {
"name": "…
AJAX
JSON
-
pravo
[ {
"name": "Branko",
"lastName": "Zecevic",
} ]
$.getJSON (url, function (data) {
$.each (data, function (index, dataSet) {
$('#main').append(dataSet.author + ' ' + index);
})
})
-
-
let obj = {
"name": "Branko",
"lastName": "Zecevic",
}
-
-
ajax()
$.ajax( url: 'someFile.txt', dataType: "text", method: 'GET',
succes: gotData,
error: noData)
functions
function gotData (data, status, xhr) {
console.log(data);
console.log(status);
console.log(xhr);
$(#result).text(data);
}
-
-
-
.load()
$('#result').load('someFile.txt', function (response, status, xhr) {
if (status === "error")
alert ('Greska'+ xhr.status + " "+ xhr.statusText);
});
-
-
-