js的跨域请求,要么在js端用jsonp来实现,要么在服务端允许跨域请求,加入一个allowCrossDomainPages 的header。
但是翻看Cordova的文档。白名单config.xml中的配置:
官方文档是这么解释的:
Domain whitelisting lays the ground work for the specification. In the Widget Access specification, the
element is used to declare access to specific network domains. In the
future, Apache Cordova will abstract the platform whitelisting
implementations to the W3C Widget Access specification. However, for now
each platform must implement it's own domain whitelisting.
也就是说,如果你需要在phonegap中需要跨域时,把该域名加入白名单中就可以了。
阅读(11185) | 评论(0) | 转发(0) |