title: How can you fetch json from an external url with javascript and/or jquery?
body: <p>I'm trying to get some json from this url : <a href="http://api.conceptnet.io/query?rel=/r/UsedFor&amp;limit=3" rel="nofollow noreferrer">http://api.conceptnet.io/query?rel=/r/UsedFor&amp;limit=3</a></p>
  <p>I have a button that calls the function &quot;jsonplz()&quot; which is supposed to give me an alert with the fetched json.</p>
  <p>My javascript looks something like this :</p>
  <pre><code>&lt;script src=&quot;http://code.jquery.com/jquery-3.3.1.min.js&quot;&gt;
  &lt;/script&gt;
  &lt;script&gt;
  function jsonplz(){
          $.getJSON(&quot;http://api.conceptnet.io/query?rel=/r/UsedFor&amp;limit=3?callback=?&quot;,function(json){
          console.log(json);
          });
  }
  &lt;/script&gt;
  </code></pre>
  <p>As you can see, I'm trying to fetch is as jsonp, hence why I added &quot; ?callback=? &quot; at the end of the url, otherwise if I was trying to get it as json, my browser would have blocked me.</p>
  <p>Here's the problem : it still doesn't work. I get this error on the firefox console when I call jsonplz() :</p>
  <p><strong>Warning</strong> : <em>The script from “https://api.conceptnet.io/query?rel=/r/UsedFor&amp;limit=3?callback=jQuery331030366838930478535_1646253265514&amp;_=1646253265515” was loaded even though its MIME type (“application/json”) is not a valid JavaScript MIME type</em>.</p>
  <p><strong>Error</strong> : <em>Uncaught SyntaxError: unexpected token: ':'</em></p>
  <p>Any solution to either solve this error or any other way to retrieve json from an external url without downloading additional third party software is appreciated</p>