I want to give variable from JSON to global variable...
See my jquery code:
$.post("php/init.php", function(data) {
data = JSON.parse(data);
});
alert(data);
var text = $("#text").val();
});
How i can alert the "data" variable.