I'm trying to do something seemingly simple, but have no idea how to
go about it.

I want to use $.getJSON to grab the data from an external JSON file,
then interact with it outside the scope of the sub-function.

I know how to do this:
$.getJSON("test.js", function(json){
    alert(json['key']);
});

But I want do do something more like this:
json = $.getJSON("test.js");
alert(json['key']);

Can anyone help me with the proper syntax?

Thanks in advance for any insight.

Reply via email to