title: Dealing with Origin http://localhost is not allowed by Access-Control-Allow-Origin Without CORS header
body: <p>So I've got a simple getJSON() function: </p>
  
  <pre><code>            $.getJSON(apiURL, function(data) {
                   console.log('success');
                  if (data.results.length &gt; 0) {
                      $(song).find('source').attr('src', data.results[0].previewUrl);
                      song.play();
                  }
                  else {
                      console.log('No match found for track information specified.');
                  }
              });
  </code></pre>
  
  <p>apiURL is an itunes API url, defined like this: </p>
  
  <pre><code>            var apiURL =" https://itunes.apple.com/search" +
                  "?term=" + artist + "+" + album + "+" + title +·
                  "&amp;media=music&amp;entity=musicTrack&amp;callback=?";
  </code></pre>
  
  <p>I'm getting the classic Origin localhost is not allowed by Access-Control-Allow-Origin error. I've dug for some answers on this, and they usually boil down to either using $.ajax and setting the dataType to 'jsonp', or using .getJSON and supplying a 'callback=?' parameter to the URL, which I've tried above. Neither of those seem to be working, and I've heard rumblings that they may be outdated. What is the most current, up to date advise on dealing with this problem? Besides collecting the data on the server. </p>