"Origin [...] is not allowed by Access-Control-Allow-Origin."

"Origin [...] is not allowed by Access-Control-Allow-Origin."

I tried to fix this with the approaches found here but the error remains, and no JSON data is fetched. I want to use an API found here but I can't get it to work. I'm aware that the code on line 7 would currently retrieve all JSON data from that url, but right now I'm just trying to get past the "Origin..." error. This is run on localhost.

Here's my code:

  1. $(document).ready(function () {


  2.     $.getJSON("https://api.tronalddump.io/random/quote", function (json) {

  3.         $("button").click(function () {
  4.             $("body").append(json);
  5.         });

  6.     });


  7. });