Variables from the anonymous function

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:

  1. $.getJSON ("/jquery.php", {event: "demo"},
  2. function(data) {
  3.     ...
  4. });

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