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 🙂
Try review technique called JSONP this way you can perform cross-site invocation