Mobile Device(file://..) Server
index.html <--JSON--- post.php
main.js
sencha_.js or Jquery_.js
情况如上, 所有文件(js、html)均由 PhoneGap 存储在移动设备上。(file://.../www/index.html...) 它将通过WebView显示。
main.js 会调用 $.ajax() 或 Ext.Ajax.request() 从服务器接收 json 数据。 (无论 POST/GET)
这可能吗?是否存在跨域问题?
最佳答案
是的,这很有可能。由于您的 PhoneGap 应用程序是从 file://协议(protocol)运行的,因此同源策略不适用,即不存在跨域问题。
关于jquery - 在phonegap/本地 jquery 或 sencha 上向远程服务器发出 Ajax 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8820124/