Search code examples
cordovajsonpcorsripple

PhoneGap/Cordova, Ripple Emulator, CORS & JSONP


Attempting to use the Ripple Emulator to test a PhoneGap application. We're making requests to the server and receiving:

ERROR:

cordova :: XMLHttpRequest :: setRequestHeader does not work with JSONP.

  • a) CORS is enabled on the server and the client
  • b) The requests work in the browser
  • c) The requests work on the mobile device
  • d) I enabled the "Allow access to file URLs" in the settings for the Ripple Chrome Extension.
  • e) I launched chrome with the flags:

--disable-web-security --allow-file-access-from-files

Does Ripple Emulator support CORS httprequest or only jsonp?

If it supports a call from more than just JSONP then I could use some assistance on implementation.

Thank you!


Solution

  • Ripple Emulator does support CORS httprequest but you need to host your html page as a website on your machine and access it using http://localhost/yourvirtualdir/yourfile.html .