Does Windows Phone 8 support a JQuery Mobile ajax call? I'm using:
$.ajax({
type: 'POST',
url: 'some URL',
data: senddata,
dataType: 'text'
});
This call works on iPhone and Android device but not on Windows 8 Phone. Is anyone using ajax to post to a URL on Windows 8 Phone?
$.ajax({
type: 'POST',
url: 'some URL',
data: senddata,
dataType: 'text'
});
This call works on iPhone and Android device but not on Windows 8 Phone. Is anyone using ajax to post to a URL on Windows 8 Phone?
- 15 Posts
- 0 Reply Likes
Posted 6 years ago
- 15 Posts
- 0 Reply Likes
Found a thread that states PhoneGap 3.x does not support ajax calls on Windows 8 platform: https://github.com/jquery/jquery-mobi...
Apparently, it's a PhoneGap framework bug. Older PhoneGap versions does support standard ajax calls.
Apparently, it's a PhoneGap framework bug. Older PhoneGap versions does support standard ajax calls.
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
I found that when using JQM on WP8 I need to add '$.support.cors = true' like this:
$(document).bind("mobileinit", function() {
$.support.cors = true;
// all your other jqm init stuff
});- 4116 Posts
- 192 Reply Likes
- 15 Posts
- 0 Reply Likes
I have read a few posts that state PhoneGap Build support for WP8 lacks support for ajax calls. Developers say ajax calls stated failing after V2.7. Do you have any plans to fix?
Here is a sample post: https://github.com/jquery/jquery-mobi...
Here is a sample post: https://github.com/jquery/jquery-mobi...
- 24 Posts
- 0 Reply Likes
Hi Ismael
I also have this issue.
This simple piece of code works for me via the browser but the Phonegap Windows App fails. I've used JSONP in attempt to fix it but again it only works in the browser.
$.ajax('http://fdiapp.com/app_cms/json/sample...',
{
jsonpCallback: 'callback',
dataType: 'jsonp'
})
.success(function(response) {
alert('$.ajax works');
console.log(response);
})
.error(function(response) {
alert('$.ajax fails');
});
This must be affecting a lot of people trying to build Windows apps via Phonegap
I also have this issue.
This simple piece of code works for me via the browser but the Phonegap Windows App fails. I've used JSONP in attempt to fix it but again it only works in the browser.
$.ajax('http://fdiapp.com/app_cms/json/sample...',
{
jsonpCallback: 'callback',
dataType: 'jsonp'
})
.success(function(response) {
alert('$.ajax works');
console.log(response);
})
.error(function(response) {
alert('$.ajax fails');
});
This must be affecting a lot of people trying to build Windows apps via Phonegap
- 33 Posts
- 1 Reply Like
This was supposed to fix this but it I still have a problem.
https://git-wip-us.apache.org/repos/a...
Note I forced 3.5 in my phonegap build by adding this to the config.xml file
https://git-wip-us.apache.org/repos/a...
Note I forced 3.5 in my phonegap build by adding this to the config.xml file
- 33 Posts
- 1 Reply Like
I finally resolved this by this method along with moving to PGB 3.5
http://timcodes.wordpress.com/2013/09...
http://timcodes.wordpress.com/2013/09...
- 24 Posts
- 0 Reply Likes
I've confirmed the issue is with PhoneGap Build. Building from Cordova locally works!!!
- 23 Posts
- 1 Reply Like
When I install tha xap file using the "Application Deployment" app Ajax calls runs fine but when I upload it to the windows store and I download it Ajax calls always returns an empty string.
- 33 Posts
- 1 Reply Like
Javier: Try the solution I posted above. It works in the store for me.
However I am still running into problems with local jumps, but that's another story.
However I am still running into problems with local jumps, but that's another story.
- 23 Posts
- 1 Reply Like
Thanks Chris C, but if I understood this solution is for local calls and my ajax call is to a web service function in a server.
Am I right?
I have found a guy that have exactly the same problem:
http://stackoverflow.com/questions/23...
Am I right?
I have found a guy that have exactly the same problem:
http://stackoverflow.com/questions/23...
- 33 Posts
- 1 Reply Like
I use getJSON for remotes. Works fine.
$.getJSON( "http://www.somewebsite.com/php/get_de... )
.done(function( json ) {
$.each(json, function(key1, item) {
stuff ...
});
})
.fail(function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
});
$.getJSON( "http://www.somewebsite.com/php/get_de... )
.done(function( json ) {
$.each(json, function(key1, item) {
stuff ...
});
})
.fail(function( jqxhr, textStatus, error ) {
var err = textStatus + ", " + error;
console.log( "Request Failed: " + err );
});
- 23 Posts
- 1 Reply Like
$.getJSON has the same problem, when I submit the app to the store calls fail
- 33 Posts
- 1 Reply Like
Did you also add these two statements to your config.xml?
<!--trying to avoid windows phone ajax issue-->
earlier versions of phonegap are supposed to have this issue. It defaults to 3.3.
<!--trying to avoid windows phone ajax issue-->
earlier versions of phonegap are supposed to have this issue. It defaults to 3.3.
- 23 Posts
- 1 Reply Like
- 33 Posts
- 1 Reply Like
Hah. They were removed from the post since it was code :-)
(access origin="*" /) <!--trying to avoid windows phone ajax issue-->
(preference name="phonegap-version" value="3.5.0" /)
Using ( instead of <
(access origin="*" /) <!--trying to avoid windows phone ajax issue-->
(preference name="phonegap-version" value="3.5.0" /)
Using ( instead of <
- 23 Posts
- 1 Reply Like
Could you send me a simple project with an ajax call for see the code and try it?
- 33 Posts
- 1 Reply Like
I don't have a simple project and am overwhelmed right now to create one, plus I have no way to test Windows Phone. My testers do that for me. This segment for jqmobile is what I use often. Its really simple but basically the same as I posted above plus the two config.xml statements.
$.ajax({
type: 'get',
url: 'channels.html',
isLocal: true,
dataType:"html"
})
.done( function(data) {
var text = $(data).find('div.ui-content .wrapper .scroller');
$("#communications .wrapper").empty();
$("#communications .wrapper").append(text);
$(':mobile-pagecontainer').enhanceWithin();
setDetailsScroller();
$.mobile.loading('hide');
}) // done
.fail(function(jqXHR, status, err){
$.mobile.loading('hide');
alert("Status:"+status+", error code:"+err);
});
- 23 Posts
- 1 Reply Like
I was using success option instead done, I'm going to try with done, thanks :-)
- 33 Posts
- 1 Reply Like
- 23 Posts
- 1 Reply Like
I have tried with the done method and the same problem, with the xap deployment toll works but downloading from the store not.
I can't believe that nobody has this problem...
I can't believe that nobody has this problem...
- 3 Posts
- 0 Reply Likes
This is still an issue with PhoneGap Build.
Ajax calls return an empty string when the app is uploaded/downloaded from the Windows App Store (it works while testing locally with the app deployment).
Ajax calls return an empty string when the app is uploaded/downloaded from the Windows App Store (it works while testing locally with the app deployment).
- 23 Posts
- 1 Reply Like
I have found the solution, put
< feature name="http://api.phonegap.com/1.0/network"/ >
in your config.xml and it will works perfectly
< feature name="http://api.phonegap.com/1.0/network"/ >
in your config.xml and it will works perfectly
- 6 Posts
- 0 Reply Likes
Thank you so much, this had me floored for a couple of weeks, ios & android worked fine, but not winphone. you're a life saver!
- 1 Post
- 0 Reply Likes
Gracias Javier, esa es la solucion.
Thanks Javier, that resolve trouble.
Thanks Javier, that resolve trouble.
Related Categories
-
PhoneGap Framework
- 2926 Conversations
- 61 Followers
-
PhoneGap Build
- 15111 Conversations
- 275 Followers





