Ajax JSON Error Windows Phone - works with iOS

261 views
Skip to first unread message

Kimmo

unread,
Aug 11, 2013, 6:48:24 AM8/11/13
to phon...@googlegroups.com
Hi,
 
I wish to get help from more experienced developers here.
 
I have a problem with Ajax JSON request with Windows Phone 7 (not tried with Windows Phone 8). All works with iOS but no result for Windows Phone and I would like to support that platform also.
 
I have JSON API in wordpress:

http://www.organisaatio-sanomat.fi/?json=get_recent_posts&count=15

This way I get results to Phonegap/Cordova app to iOS.

 

My code that works for iOS (URL is http://www.organisaatio-sanomat.fi/?json=get_recent_posts&count=15)

jQuery.ajax({

url: URL,

type: 'GET',

//timeout: 2000, // 2 seconds timeout

dataType: 'json',

success: function(data) {

$.each(data.posts, function(i,data)

{...

 

This works as a charm. But Windows Phone gives different errors when I try different things: mainly these two:

"readyState":0, "status":0, "statusText":"Error: No Internet session has been established./r/n"

or

"readyState":4, "status":404, "statusText:"error"

 

I have tried to use $.support.cors = true;, whitelisting in confic.xml, jsonp as dataType, application/json, text/plain, CrossDomain = true, adding &callback=? into URL, timeout, async...

It just goes always to error section of ajax search and never to success part.

 

Any ideas how I could get this working with Windows Phone 7 - I have tried to emulate this on emulator. Really would like to support this 3rd platform :(

 

Cheers,

Kimmo

 

 

 

 

 

kuva1.PNG
kuva2.PNG

ConchitaBH

unread,
Aug 13, 2013, 12:42:11 PM8/13/13
to phonegap
I replace all the $ with jQuery
$.each(data.posts, function(i,data)
jQuery.each(data.posts, function(i,data)


2013/8/11 Kimmo <kimmo.k...@gmail.com>
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Ing. Concepción Bautista H

Kimmo

unread,
Aug 13, 2013, 4:31:43 PM8/13/13
to phon...@googlegroups.com
Hi,
 
Actually the fault was in the emulator. Content comes nicely with actual Lumia hardware.
 
Thanks
Kimmo
Reply all
Reply to author
Forward
0 new messages