title: JSON Get request using JQuery (cross-domain)
body: <p>I'm trying to make a simple JSON get request to an API on a domain that I do not control.</p>
  
  <p>My code is simply:</p>
  
  <pre><code>$(document).ready(function () {
          $.ajax({
              type: 'GET',
              url: 'http://pubapi.cryptsy.com/api.php?method=marketdatav2',
              success: function (data) {
                  console.log(data);
              }
          });
  });
  </code></pre>
  
  <p>But since that is a cross-domain request, I am getting this error in the Chrome Console:</p>
  
  <p><code>XMLHttpRequest cannot load http://pubapi.cryptsy.com/api.php?method=marketdatav2. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access.</code></p>
  
  <p>And when I try to add the parameter <code>dataType: 'jsonp'</code> the Console returns with this error:</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected token : </p>
  </blockquote>
  
  <p>But when I examine the Network tab in Chrome I see that under Headers the Status Code is 200 OK and I can actually see the full response in the Response tab, but the console is still showing the "Unexpected Token :" error and the JQuery JSON request is still failing.</p>
  
  <p>Here's the JS Fiddle link: <a href="http://jsfiddle.net/6Qcq2/" rel="noreferrer">http://jsfiddle.net/6Qcq2/</a> You can see the same results </p>
  
  <p>I have tried running the url on <a href="http://www.hurl.it" rel="noreferrer">http://www.hurl.it</a> and it shows me Status OK and the response as well, so I must be doing something wrong. </p>
  
  <p>I've pretty much wasted the whole day trying to figure out how to get around this problem. </p>
  
  <p>Your help is very much appreciated.</p>