Note that there are some explanatory texts on larger screens.

plurals
  1. POJSON data won't be displayed via jQuerys getJSON()
    primarykey
    data
    text
    <p>The following code should display the <code>id</code> out of the JSON-object, which I got from a server. I cant find the mistake, could somebody help me? Thank you in advance!</p> <p>The JSON-object which is returned when <code>http://localhost:8387/nscalemc/rest/mon/resourcestatus.json</code> is called:</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": [] }, { "id": "Application Layer-ApplicationLayer:nscalealinst1", "time": 1333431531046, "level": 1, "warningIds": [ "documentarea.locked" ], "errorIds": [] }, { "id": "Storage Layer-StorageLayerInstance1", "time": 1331208543687, "level": 0, "warningIds": [], "errorIds": [] } ] } </code></pre> <p>My HTML file <code>gadget.html</code>:</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;script type="text/javascript" src="js/gadget.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>My JavaScript file "gadget.js":</p> <pre><code>fetch_JSON(); function fetch_JSON() { var url = "http://localhost:8387/nscalemc/rest/mon/resourcestatus.json"; $.getJSON(url+'?callback=?', function(data) { $(data.groupStatus).each(function() { $('#content').append('&lt;p&gt;ID: ' + $(this).id+ '&lt;/p&gt;'); }); }); } </code></pre> <p><strong>EDIT:</strong> Thank you for your solutions! I debugged via Firebug and found out, that the getJSON-call ends with status "401 unauthorized"..</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.
 

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