问题
I need some help with the application I'm creating.
I'm using jquery 11 and I need to retrieve a json file using ajax. The problem is that the code works ok in desktop browsers but no if I run the application on a mobile. I'm also using bootstrap 3 (it requires to use jquery) so I think I cannot also add Jquery mobile. Does anybody know how can I fix this?
Thanks in advance :) Cheers
This is my code:
$(document).ready(function ()
{
$.ajax({
cache: false,
url: 'http://localhost:8080/mobile/json/staffing.json',
type: 'get',
dataType: "json",
success: function(json)
{
alert("loaded");
},
error: function(){
alert("not working")
}
});
});
来源:https://stackoverflow.com/questions/23901366/ajax-call-to-get-json-not-working-on-mobile-browsers