Variables from the anonymous function
Hi,
I hope somebody can help me: I have been banging my head for a couple fo hours now! :)
I am using .getJSON() to obtain some data from my server in the following way:
- $.getJSON ("/jquery.php", {event: "demo"},
- function(data) {
- ...
- });
Is it possible, and if so how, to make "data" a global variable?
In other words, what do I need to do in order to use what the server returns (ie "data") outside of the anonymous function?
Thanks,
Adrien