jQuery $.getJSON method still giving CORS error
<p>Here's my code based off this <a href="https://stackoverflow.com/questions/2604082/using-jquery-getjson-method">question</a></p>

<pre><code>$(document).ready(function(){
  $('#new-quote').click(function(){
    var url = 'http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=_';
    $.getJSON(url, function(data){
      console.log(data);
    });
  });
});
</code></pre>

<p>This get's me the error:</p>

<blockquote>
  <p>XMLHttpRequest cannot load <a href="http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=_" rel="nofollow noreferrer">http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=<em></a>. Redirect from '<a href="http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=_" rel="nofollow noreferrer">http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=</em></a>' to '<a href="http://forismatic.com/" rel="nofollow noreferrer">http://forismatic.com/</a>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' is therefore not allowed access.</p>
</blockquote>

<p>I've also tried the code:</p>

<pre><code>$(document).ready(function(){
  $('#new-quote').click(function(){
    var url = 'http://api.forismatic.com/api/1.0/?format=jsonp&amp;jsonp=_';
    $.getJSON(url).done(update).fail(err);
    function update(response){
      console.log(response);
    }
    function err(jqxhr, textStatus, err){
      console.log('Request failed');
    }  
  });
});
</code></pre>

<p>And it gives me the same error. Along with the 'Request failed message'. I'm using jQuery 3.1.1. What am I missing here? Sorry if this is a duplicate but I've read the questions here and haven't found the answer</p>

<p>This <a href="https://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work">question</a> asks about the underlying concept of Access-Control-Allow-Origin. The guy also literally states that he doesn't want to use jsonp. I want use jsonp format with $.getJSON format and am not sure why it's not working.</p>