[jQuery] Re: assigning data from $.getJSON() to a global variable?

2008-03-31 Thread funkadelic
rk, as would this: > > var globalX; > > function foo() { > $.getJSON("jsondata.js", dataReady); > > } > > function dataReady( data ) { > alert( data ); > > } > > -Mike > > > -Original Message- > > From: jquery-en@goo

[jQuery] assigning data from $.getJSON() to a global variable?

2008-03-27 Thread funkadelic
Hi, Is there a way to take the JSON from a $.getJSON() call and assign it to a var in the global scope? i tried the following but it didn't work: var globalX; function foo() { $.getJSON("jsondata.js",function(data){ globalX = data; }); } thanks