jquery.load() not working on phonegap

前端 未结 2 480
悲&欢浪女
悲&欢浪女 2021-01-28 06:05

I am developing buyers guide app with phonegap. where i am trying to fetch some info from server using jquery. but when i run following code with phonegap its not working

<
相关标签:
2条回答
  • 2021-01-28 06:25

    Are you testing on simulator or on a device?

    You can't use localhost on a device because localhost is the device, you have to use the server local IP instead

    And you have to whitelist the IP too (or use *, it whitelist all the IPs) whitelist guide

    0 讨论(0)
  • 2021-01-28 06:28

    Do you have CORS enabled on the server?

    PhoneGap loads the index.html from the local filesystem and the same origin policy prevents ajax calls to different domains, such as localhost.

    0 讨论(0)
提交回复
热议问题