Note that there are some explanatory texts on larger screens.

plurals
  1. POwht does jQuery also append code to the end of an ajax call?
    text
    copied!<p>Can anyone tell my what this is that jquery has added to the end of my output to "posts-container" and how to fix it? Its not coming from the json so what is the issue. code is below and the output is adding at the end.</p> <p>Thanks in advance.</p> <pre><code>$(document).ready(function(){ $('#waiting').show(500); $('#message').hide(0); $.ajax({ type: 'get', url: 'http://domain.com/api/index.php/id/18271', dataType: 'json', data: 'apiKeytest=1', success: function(r){ var output = ''; for (a in r.DATA) { for (b in r.DATA[a]) { if (typeof(r.DATA[a][b]) == 'object') { for (c in r.DATA[a][b]) { output += c + ' = ' + r.DATA[a][b][c] + '&lt;br /&gt;'; } } else { output += b + ' = ' + r.DATA[a][b] + '&lt;br /&gt;'; } } } jQuery('#posts-container').append(output); }, error: function(XMLHttpRequest, textStatus, errorThrown){ $('#waiting').hide(500); $('#message').removeClass().addClass('error').text('There was an error.').show(500); } }); return false; }); </code></pre> <p>output has this at the end</p> <pre><code>argumentNames = function () { var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); return names.length == 1 &amp;&amp; !names[0] ? [] : names; } bindAsEventListener = function () { var __method = this, args = $A(arguments), object = args.shift(); return function (event) {return __method.apply(object, [event || window.event].concat(args));}; } curry = function () { if (!arguments.length) { return this; } var __method = this, args = $A(arguments); return function () {return __method.apply(this, args.concat($A(arguments)));}; } delay = function () { var __method = this, args = $A(arguments), timeout = args.shift() * 1000; return window.setTimeout(function () {return __method.apply(__method, args);}, timeout); } etc............ </code></pre> <p>the json</p> <pre><code>{ "ERRORS": [], "DATA": [ { "itemActive": true, "itemTxt": "test", "itemID": "30d2f2c1-58ca-4b3d-b3e0-d284ae5b25ab", "itemValidTo": "October, 19 2011 00:00:00", "itemName": "test", "itemCreated": "October, 03 2011 00:00:00", "image": { "imageCreated": "October, 05 2011 00:00:00", "imageURL": "test.jpg", "imageID": "bc869a94-fee5-4fc8-bd21-e2de2f020310" }, "itembio": 53.0650849 } ], "MESSAGES": [ { "TOTAL": 1, "CURRENTPAGE": 1, "TOTALPAGES": 1 } ] } </code></pre>
 

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