Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 741
Brian Zitzow Avatar asked Feb 25 '13 21:02

Brian Zitzow


1 Answers

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 .

like image 113
Nishanth Nair Avatar answered Sep 28 '22 08:09

Nishanth Nair