I'm having problem using variables outside a $.get function, the variable isn't found and the script stops.
What can I do?
$.get("../ajax.php", function (data) {
var json = JSON.parse(data);
test = json['jquery']['test'];
});
alert(test)
UPDATE: (This solved my problem) I get the json with $.get. And pass it to my function and the json will be able to get later in the script.
$.get("../ajax.php", function (data) {
function(data) {
loadApp(data);
});
function loadApp(data) {
json = JSON.parse(data);
}