# Solved: $.getJSON not working??



## cpscdave (Feb 25, 2004)

I'm hoping someone can give me insight into what is happening.
I have the following code.


```
var test = 10;
alert("TEST: " + test);
$.getJSON(url, jsonOptions, 
 function(data){
alert("here");
test = 20;
	});
alert("TEST: " + test);
```
I'm fairly sure that it's hitting the url correctly as if i copy the request from firebug and put it into my webbrowser it gives the expected output, in addition firebug is showing the response as correct.

However when I run this I'm getting only 2 alerts bot saying 
Test: 10

So for some reason it's not going into my function(data){ code.

Any ideas as to why?

the output (right now) of the script i'm calling is simply { name : test }


----------



## cpscdave (Feb 25, 2004)

I got it to work.
TBH I dont really know what exactly changed


----------

