I am developing a PhoneGap application for Windows Phone 7, and I am making several jQuery AJAX calls there. In particular, I send POST data to login to a remote script.
The answer is in JSON when our script receives these credentials for entering the POST data, otherwise it returns the HTML of the full login page.
I sure that:
- I have a whitelisted domain
- I allowed cross-domain requests using $ .support.cors = true and $ .mobile.allowCrossDomainPages = true
- this is not a problem with configuring the cache: false (already played with it)
- passing data as a JSON object does not work.
- playing with contentType values didn't help
When I try to use the POST method, however, no data is passed to the actual script .
I found an old similar problem that was related to Internet Explorer desktop. In my case, however, I cannot publish data at all - not on the first attempt, but not on the second or any other subsequent attempt.
$.ajax({ url: "http://www.mypage.com/", type: "post", data: "login="+$('#login').val()+"&pw="+$('#pw').val(), dataType: "json", cache: false, success: function(loginReturn, status, request) {
source share