I've been at this for a while, but am missing something. I've just set up a simple Sinatra app returning JSON:

```
get '/json' do
  content_type :json
  $data.to_json
end

```

This is working fine, and then the javascript I'm using to do a cross domain request is 

```
$.getJSON("http://domain.com/json?callback=?", function(data) {
   console.log(data);
});

```

Unfortunately with this I just keep getting the error in the console `Uncaught SyntaxError: Unexpected token :` and although I've tried a just using the `$.ajax` method instead, I still get the same result. 

Is this an error on my server or client side code? any help appreciated.