PhoneGap and Jquery Ajax Call (POST) in Windows Phone

I faced a Ajax call errorĀ  in Windows Phone with Phonegap. When I tried to send some day using Ajax in PhoneGap I got this error message always “No Transport”. I always got same error message saying “No Transport”. Then I started web search and found out a solution. Some of them saying Windows Phone IE9 browser won’t support cross domain AJAX requests. (Ajax request is not working in Windows Phone and PhoneGap)

PhoneGap Logo with Windows Phone Android iOS Bada Blackberry
PhoneGap Logo with Windows Phone, Android, iOS, Bada, Blackberry

Solution is :- we have to add this line before ajax call function $.support.cors = true;

for example :- Like this

$.support.cors = true;

$.ajax({
url: “http://localhost:1254/Base64ImageServer/Default.aspx”,…….});

Then It started showing Unkown error message.

I got few more suggestion in my research.

They’re say change one line in PhoneGap1.4.1.js file

win.XMLHttpRequest = function(){}; to win.XMLHttpRequest = false;

I am not sure this is best solution. but it is work. if any one knows better solution for this please put in comments.

2 thoughts on “PhoneGap and Jquery Ajax Call (POST) in Windows Phone

Leave a Reply