title: Jquery getJSON Uncaught SyntaxError: Unexpected token : error
body: <p>I am trying to connect to the <a href="http://guides.rubygems.org/rubygems-org-api/" rel="nofollow">RubyGems API</a>, but when I try to get the JSON I get an stange error.</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token :
  </code></pre>
  
  <p>I have seen this error in other questions and posts, but none of the worked for me. </p>
  
  <p>Here is my $.getJSON() function</p>
  
  <pre><code>.getJSON("http://rubygems.org/api/v1/gems/rails.json?jsoncallback=?", function(data) {
    ...function stuff....
  });
  </code></pre>
  
  <p>This is the JSON that I should receive:</p>
  
  <pre><code>{"dependencies":{"runtime":[{"name":"actionmailer","requirements":"= 3.0.9"},{"name":"actionpack","requirements":"= 3.0.9"},{"name":"activerecord","requirements":"= 3.0.9"},{"name":"activeresource","requirements":"= 3.0.9"},{"name":"activesupport","requirements":"= 3.0.9"},{"name":"bundler","requirements":"~&gt; 1.0"},{"name":"railties","requirements":"= 3.0.9"}],"development":[]},"name":"rails","downloads":4474748,"info":"Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.","version_downloads":93309,"version":"3.0.9","homepage_uri":"http://www.rubyonrails.org","bug_tracker_uri":"http://rails.lighthouseapp.com/projects/8994-ruby-on-rails","source_code_uri":"http://github.com/rails/rails","gem_uri":"http://rubygems.org/gems/rails-3.0.9.gem","project_uri":"http://rubygems.org/gems/rails","authors":"David Heinemeier Hansson","mailing_list_uri":"http://groups.google.com/group/rubyonrails-talk","documentation_uri":"http://api.rubyonrails.org","wiki_uri":"http://wiki.rubyonrails.org"}
  </code></pre>
  
  <p>Can someone please help me :)</p>