AJAX Request from Phonegap Android fails

前端 未结 3 345
Happy的楠姐
Happy的楠姐 2020-12-02 20:50

I have been working on this for the last two days, and looking at a lot of other suggestions. Yes I can get this simple ajax request to work from within a phonegap applicati

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 21:25

    You should whitelist the domain in order for your AJAX calls to work.

    Add this line to config file -:

    
    

    Phonegap's default policy blocks all network access unless specified otherwise. The above line will disable this security restriction. You can also be more specific in allowing only certain domains to bypass this security feature by including the domain name in the config file like so

    
    

提交回复
热议问题