I have a small web page that uses jQuery.ajax(). The ajax call works fine on a desktop browser (Chrome on Mac). But when I try the same web page on my Android device (Chrome on Nexus 5), I get a net::ERR_CONNECTION_REFUSED.
Here are the details of the ajax call from the Chrome Inspector when I do remote debugging with my Android device:
Request URL:http://<someURL>:<somePort>/xxxx Request Headers CAUTION: Provisional headers are shown. Accept:*/* Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Origin:http:http://<someURL>:<somePort>/ Referer:http://<someURL>:<somePort>/xxxx User-Agent:Mozilla/5.0 (Linux; Android 4.4.3; Nexus 5 Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/35.0.1916.141 Mobile Safari/537.36
The Preview and Response panes of Chrome Inspector both say 'Failed to load response data'
Here is my ajax call:
$.ajax({ url: /path/, type: 'POST', data: requestObject, success: function(data) { // some code here }, error: function(jqXHR, status, error) { // some code here }, });
The error handling function always gets called in the case of Android. For desktop, the call always succeeds (success handler).
I'm a newbie with device Android web testing/debugging. Anything will help. Thanks