Ajax call to get json not working on mobile browsers

拈花ヽ惹草 提交于 2020-01-24 22:04:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!