Note that there are some explanatory texts on larger screens.

plurals
  1. POjsonp request not working in firefox
    primarykey
    data
    text
    <p>I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. <a href="http://api.reddit.com" rel="nofollow noreferrer">http://api.reddit.com</a>. This returns a valid json object.</p> <p>If I call a local file (which is what is returned from the website saved to my local disk) things work fine. </p> <pre><code>$(document).ready(function() { $.getJSON("js/reddit.json", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>If I then try to convert it to a remote call:</p> <pre><code>$(document).ready(function() { $.getJSON("http://api.reddit.com", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>it will work fine in Safari, but not Firefox. This is expect as Firefox doesnt do remote calls due to security or something. Fine.</p> <p>In the jquery docs they say to do it like this (jsonp):</p> <pre><code>$(document).ready(function() { $.getJSON("http://api.reddit.com?jsoncallback=?", function (json) { $.each(json.data.children, function () { title = this.data.title; url = this.data.url; $("#redditbox").append("&lt;div&gt;&lt;a href=\"" + url + "\"&gt;" + title + "&lt;/a&gt;&lt;div&gt;"); }); }); }); </code></pre> <p>however it now stops working on both safari and firefox. The request is made but what is return from the server appears to be ignored.</p> <p>Is this a problem with the code I am writing or with something the server is returning? How can I diagnose this problem?</p> <p><em>EDIT</em> Changed the address to the real one.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload