[jQuery] How to access variable outside function

[jQuery] How to access variable outside function


i sometimes do something like
var i;
$.getJSON("url", function (json) {
// update i
i = json.var;
});
how can i access the updated i outside the function(json)...?