I started using jQuery and ajax to get data from database, but i cant find out how i can save result of $.get() into variable outside callback function.
This is my j
Try this:
var result = ""; $.get("test.php", function (data) { SomeFunction(data); }); function SomeFunction(data) { result = data; alert(result); }