GetJSON not working in Cordova 2.1.0 on iOS

I am developing a Phonegap application for iOS. I'm new to both!

In any case, it looks good, but I cannot get the next JSON call to run. It does not get to the server - there is nothing in the logs.

I get a warning in, but not a warning out.

The code works fine from a standard web page.

I turned on

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script> 

I added * to ExternalHosts from Cordova.plist, as I found in the mighty Google!

What did I miss?

Thanks.

 function GetData(){ alert('in'); $.getJSON('http://dev.myurl.com/brief/getdata.php', function(data) { $.each(data, function(key, val) { alert(val.itemValue); }) // each }// function );//getjson alert('out'); } 
+4
source share
1 answer

You have already tried this:

 function GetData(){ alert('in'); $.get('http://dev.myurl.com/brief/getdata.php', function(data){ $.each(data, function(key, val) { alert(val.itemValue); }) }), 'json'; alert('out'); } 
0
source

All Articles