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!

Was it helpful?

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 .

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top