jQuery code:
$.ajaxSetup({ cache: false });
$('#stid_status_msg').hide();
$('.SpeedTestId').blur(function(e) {
e.preventDefault();
var stid = $('.SpeedTestId').val();
var postString = 'stid=' + stid;
/* $.ajax({
cache: false,
url:"inc/check_stid.inc.php",
type:'POST',
data:postString,
success:function(msg) {
$('#stid_status_msg').html(msg);
$('#stid_status_msg').show();
},
error:function(error) {
$('#stid_status_msg').html('Error submitting results!' + error + '');
$('#stid_status_msg').show();
}
});*/
$.get("inc/check_stid.inc.php", { stid: stid }, function(msg) {
$('#stid_status_msg').html(msg);
$('#stid_status_msg').show();
});
});
The commented out $.ajax() method is what I was trying originally, but quickly discovered $.get() was a better method for what I was trying to do. But regardless of which method I use the code works fine in desktop browsers (FF,IE,Chrome), but does not complete successfully in the Android browser.
When I use $.ajax(), and I test in the Android browser it first hangs for several seconds, and then the error callback fires and I get:
Error submitting results! [object][object]
I should also note that when I enable the java console in the Android browser, it does not indicate any errors with the JS.
So it occurs to me that the script is not able to find/load inc/check_stid.inc.php for some reason. But why only in the Android browser?
Obviously I'm a jQuery newbie, and I appreciate any insight you folks can provide.
Edit
I installed FF on my android and the code works fine there as well. Whatever I am encountering is specific to the android browser. Very strange!