Reputation: 11725
The first action available in my mobile app is a login. The form calls the javascript:
$.post('http://www.website.com/m/users/login', ...
I use a catch-all ajax error:
$(document).ajaxError(ajaxError);
function ajaxError() {
hideLoader();
enableForm( $('form:visible') );
alert('Uh oh! An error occurred. Please make sure you have an internet connection and try again.');
}
And that alert is all I get when I try to log in.
Even though it isn't cross domain (the mobile site is at mobile.website.com
), I have tried:
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
But it still isn't working. At this point I'm out of ideas, so I thought I'd see if anyone knew of any other possible roadblocks for JQM ajax requests.
Thanks :)
Upvotes: 0
Views: 117
Reputation: 40503
Using YQL will also let you do Cross domain AJAX calls
Build your URL query using YQL Console and use the YQL query directly in your code and you will get the response reliably
Upvotes: 0
Reputation: 23624
Try review technique called JSONP this way you can perform cross-site invocation
Upvotes: 1
Reputation: 95022
You are performing a cross-domain request,www.website.com
is not the same domain as mobile.website.com
. You either need to expose the methods on the mobile.website.com domain, make www.website.com support CORS, or provide some kind of proxy between the two.
Upvotes: 1