Note that there are some explanatory texts on larger screens.

plurals
  1. PO"invalid label" when using JSONP?
    primarykey
    data
    text
    <p>I've got a problem with my JSONP request.. The data won't be displayed, Firebug shows an "invalid label" error..</p> <p><img src="https://i.stack.imgur.com/gBEj1.png" alt="enter image description here"></p> <p>My JavaScript:</p> <pre><code>$.ajax({ url: link, dataType: "jsonp", beforeSend: function(xhr) { var base64 = btoa(username + ":" + password); xhr.setRequestHeader("Authorization", "Basic" + base64); xhr.overrideMimeType("application/json"); }, jsonpCallback: "getResources" }) function getResources(data) { alert(data); alert(JSON.parse(data)); $.each(data.groupStatus, function(i, item) { $("body").append("&lt;p&gt;ID: " + item.id + "&lt;/p&gt;"); }); } </code></pre> <p>My JSON:</p> <pre><code>{ "groupStatus": [ { "id": "Application Layer Configuration-ApplicationLayer", "time": 1332755316976, "level": 0, "warningIds": [], "errorIds": [] }, { "id": "Application Layer-ApplicationLayer:nscalealinst2", "time": 1333431531046, "level": 0, "warningIds": [], "errorIds": [] } ] } </code></pre> <p>My HTML:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Monitor&lt;/title&gt; &lt;link href="css/gadget.css" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript" src="js/jquery-1.7.2.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;script type="text/javascript" src="js/gadget.js"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre> <p></p> <p>The request works fine, but anyway the data isn't displayed.</p> <p><img src="https://i.stack.imgur.com/tABcy.png" alt="enter image description here"></p> <p>Im searching for a solution for days.. Can somebody help me? Thank you in advance!</p> <p><strong>SOLUTION</strong> (update: 06.09.12)</p> <p>I've solved this problem. The server (REST interface) on which the was executed had no callback function implemented.. Another way to set up crossdomain requests WITHOUT using JSONP is to set the following jquery variable:</p> <pre><code>jQuery.support.cors = true; </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.
 

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