Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Like @Pointy said, response is not getting parsed as json, but as script. So <code>eval</code> function is being executed.</p> <pre><code>eval('{"new-files-from-user":[]}'); </code></pre> <p>and it is giving error.</p> <p>In the case of jsonp if the url is <strong>http://marketplace.envato.com/api/edge/new-files-from-user:mechabyte,themeforest.json</strong>, call should be made as</p> <pre><code>http://marketplace.envato.com/api/edge/new-files-from-user:mechabyte,themeforest.json?callback=mycallback </code></pre> <p>and response should be</p> <pre><code>mycallback({"new-files-from-user":[]}); </code></pre> <p>and if you have a function <code>mycallback</code></p> <pre><code>eval('mycallback({"new-files-from-user":[]});'); </code></pre> <p>will work</p> <p>or if you don't set a callback</p> <pre><code>http://marketplace.envato.com/api/edge/new-files-from-user:mechabyte,themeforest.json?callback= </code></pre> <p>the response should be</p> <pre><code>({"new-files-from-user":[]}); </code></pre> <p>then </p> <pre><code>eval('({"new-files-from-user":[]});'); </code></pre> <p>will work</p> <p>In your case you can see that each time jQuery is setting the parameter <code>callback</code> like</p> <pre><code>callback=jQuery171009222313176259944_1327017091413 </code></pre> <p>so the response should be</p> <pre><code>jQuery171009222313176259944_1327017091413({"new-files-from-user":[]}); </code></pre> <p>e.g: <a href="https://twitter.com/statuses/user_timeline/tomhanks.json?callback=myCallback&amp;count=5" rel="nofollow">https://twitter.com/statuses/user_timeline/tomhanks.json?callback=myCallback&amp;count=5</a></p> <p>But as the response is a json string this will work. (subject to same origin policy) </p> <pre><code>$.get("http://marketplace.envato.com/api/v3/new-files-from-user:turkhitbox,themeforest.json?callback=?", function (data){ data = $.parseJSON(data); console.log(data); }); </code></pre>
    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.
    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