对于OpenCPU的测试部署,我有一个与COR相关的错误,这可能会有自己的问题,但是现在我希望它在没有通过弹出窗口通知最终用户的情况下失败 - 这可能吗?
我在浏览器控制台中看到的错误是由于网站在导航时交换了TLD:
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.
出现一个弹出窗口:
我想确保如果将来可能出现错误,它不会影响用户体验 - 在这种情况下,OpenCPU用于网站的非必要功能。
答案 0 :(得分:0)
通过非特定的OpenCPU question
找到 // suppress alerts
window.alert = function ( text ) { console.log( 'tried to alert: ' + text ); return true; };