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
.
PhoneGap/Cordova, Ripple Emulator, CORS & JSONP
Question
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
OTHER TIPS
Instead of setting up a virtual directory or IIS entry, use PHP's built-in development web server. This works in Windows and Linux environments.
http://php.net/manual/en/features.commandline.webserver.php
$ cd ~/public_html
$ php -S localhost:8000
Now you can open your browser and navigate to http://localhost:8000
and your site\app will be served up. Then you can enable Ripple on that URL.