Note that there are some explanatory texts on larger screens.

plurals
  1. POAdobe Air, and getting data through JSONP
    primarykey
    data
    text
    <p>I'm using javascript/jQuery in conjunction with Adobe Air, and for some reason, I just can not get it working so that I can pull data from the server. </p> <p>This works fine in the browser (the individual items append properly to the ul, and the popup says "SUCCESS"), but when I run it in Adobe Air, it appears not to be working (getting a popup that says "ERROR", and the ul is not getting written to).</p> <p>Here's my JS code:</p> <pre><code>jQuery("#whatever").append("&lt;ul&gt;&lt;li&gt;test&lt;/li&gt;&lt;/ul&gt;"); var url = 'http://www.mysite.com/test.php?callback=?'; var data = ''; jQuery.ajax({ type: 'GET', url: url, async: false, jsonpCallback: 'jsonCallback', contentType: "application/json", dataType: 'jsonp', success: function(data) { alert("SUCCESS"); jQuery.each(data, function() { jQuery.each(this, function(k, v) { jQuery("&lt;li&gt;&lt;/li&gt;").html(v.siteName).appendTo("#whatever ul"); }); }); }, error: function(e) { alert("ERROR"); console.log(e.message); } }); </code></pre> <p>And the JSON code on the server:</p> <pre><code>jsonCallback( { "sites": [ { "siteName": "JQUERY4U", "domainName": "http://www.jquery4u.com", "description": "#1 jQuery Blog for your Daily News, Plugins, Tuts/Tips &amp;amp; Code Snippets." }, { "siteName": "BLOGOOLA", "domainName": "http://www.blogoola.com", "description": "Expose your blog to millions and increase your audience." }, { "siteName": "PHPSCRIPTS4U", "domainName": "http://www.phpscripts4u.com", "description": "The Blog of Enthusiastic PHP Scripters" } ] } ); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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