0

I have an error related to CORs for a test deployment of OpenCPU, which may get its own question, but for now I'd like it to fail without notifying the end user via a popup - is this possible?

The error I see in the browser console is due to the website swapping TLD as you navigate:

XMLHttpRequest cannot load http://104.XX.3.XX/ocpu/library/predict/R/. The 'Access-Control-Allow-Origin' header has a value 'http://www.XXXX.com' that is not equal to the supplied origin. Origin 'http://www.XXXX.dk' is therefore not allowed access.

And a popup appears:

enter image description here

I'd like to ensure if there are possible future errors it doesn't detract for the user experience - in this case OpenCPU is used for a non-essential function of the website.

MarkeD
  • 2,500
  • 2
  • 21
  • 35

1 Answers1

0

Found via a non-specific to OpenCPU question

// suppress alerts window.alert = function ( text ) { console.log( 'tried to alert: ' + text ); return true; };

Community
  • 1
  • 1
MarkeD
  • 2,500
  • 2
  • 21
  • 35