22

I'm using PhoneGap and JavaScript to produce an iPhone app. Is it possible to send a cross-domain AJAX (POST) request and download the response as HTML? (ex.: sign into yahoo mail and fetch new mails)

Brad Koch
  • 19,267
  • 19
  • 110
  • 137
Pharaz Fadaei
  • 1,605
  • 3
  • 17
  • 28

1 Answers1

30

Cordova/PhoneGap allow for whitelisting of domains. As long as the server you are requesting is in the whitelist.

Chris Sobolewski
  • 12,819
  • 12
  • 63
  • 96
  • So then it's not possible if the server doesn't accept CORS or JSONP ? – Pharaz Fadaei Dec 17 '12 at 19:52
  • 12
    Actually, the server does not have to support CORS or JSONP in order to make a cross-domain ajax request. The only requirement is to add your domain to the official whitelist inside of your phonegap project(here is the guide) : http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html – Aki Dec 17 '12 at 20:57
  • Just a quick note - you need to add ``. Don't use uri attribute with PhoneGapBuild. – Nux Jul 23 '13 at 12:17