i just want to ask, how can i save my json file from url in some variable. And then, how can i work with it?
normally it go so:
var jsonOriginal = { name: "Steve", age: 27, jobTitle: "Program Manager" };
alert(person.name);
but now i need json from specific url...with objects inside objects... how can i save this json to var and then call an work with specific object inside othe
it go so, if i use only URL. But i need json inside variable:
$.getJSON('http://192.168.1.101:8080/mbx/labResults.json', function(data) {
for(var i=zacetek; i<strani; i+=1){
var avtorizacija;
if(data[i].authorizationStatus=="true") avtorizacija = "Da"; else avtorizacija = ""
$('#myTable2').append("<tr><td><input id='checkbox' type='checkbox' />" +
"<td>" + data[i].id64.labId + "/" + data[i].id64.protocol + "</td>" +
"<td>" + data[i].patient.name.toUpperCase() + "</td>" +
"<td>" + data[i].patient.kzzNumber + "</td>" +
"<td>02.02.2012</td>" +
"<td>kri, blato</td>" +
"<td>virologija</td>" +
"<td>" + avtorizacija +"</td>" +
"<td>" + data[i].resultDate +"</td>" +
"<td>" + data[i].resultDate +"</td></tr>"
);
}
});
thanks