I am trying to connect to the RubyGems API, but when I try to get the JSON I get an stange error.
Uncaught SyntaxError: Unexpected token :
The browser is interpreting the curly brackets as a block. The API needs to return a function call with the JSON data as the argument (using the supplied callback name). It doesn't appear that this API supports JSONP & the callback parameter so you'll need to contact them to ask for this support.
It should return something like:
jsonp1279196981233({ ... })
rather than simply:
{ ... }
because the client will be evaluating it as a script. In JavaScript a set of stand alone curly braces will denote a block.