尝试从我的域重定向到另一个域时,我遇到了一个奇怪的错误。这是我想要做的:
location.href="https://paystack.com/secure/xxx"
这是错误:
Failed to load https://paystack.com/secure/xxx: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:59610' is therefore not allowed access
我能做些什么才能通过这个?
我终于搞定了。这就是我做的
window.location.replace('domain');
window.location.href ='domain'