I have a global variable called sections. However, on a certain onclick event, i want to grab those sections via Jsonp and update them.
So my come looks something like this:
var sections = [bla];
new Request.JSONP({
url: 'someurl',
onComplete: function(theData){
sections = theData;
doStuff();
}
}).send();
var doStuff = function(){
console.log(sections);
}
But if i run that, i get that sections is still equal to [bla] and not
[foo] which the json data should be.
Why is that?
