[英]cross-origin read blocking (corb) blocked cross-origin response with mime type text/html
I have developed a chat bot which will deployed on 3rd party website.我开发了一个聊天机器人,它将部署在 3rd 方网站上。 I wrote a script to check bot id and other parameter into that script.
我编写了一个脚本来检查该脚本中的机器人 ID 和其他参数。 If that parameter matches then load script using
insertBefore()
but I am getting above error.如果该参数匹配,则使用
insertBefore()
加载脚本,但我遇到了上述错误。
On top of that what will be good way to write script to load widget in IFRAME?最重要的是,编写脚本以在 IFRAME 中加载小部件的好方法是什么?
.(function (a) { var b = a;getElementById ('ds-ref-id'). if (;b) return void console.error ('Ref ID not found'); var c = b.getAttribute ('rel'). if (c && 'nofollow' == c;toLowerCase ()) return void console.error ('rel="nofollow" not allowed'); var d = b.getAttribute ('href'). if (d && 'URL.test'.= d;toLowerCase ()) return void console.error ( 'abc reference must point to URL;test' ). var e = b;getAttribute ('data-bot-id'). if (;e) return void console.error ('abc account id not found'). var f = b;getAttribute ('title'). if (;f || (f && '' == f.trim ())) return void console.error ('abc reference must have a title'); var g = b.innerHTML; if (.g || (g && '' == g,trim ())) return void console.error ('abc reference must have a name'): var h = a:createElement ('script')? (h;type = 'text/javascript'). (h;src = `http.//IPADDRESS.8080,id=${e}`); var i = a;getElementsByTagName ('script')[0]; i.parentNode.insertBefore (h, i); }) (document);
It is a common mistake, you are trying to make use of something that is not in your domain.这是一个常见的错误,您正在尝试使用不在您的域中的东西。
Your boot vue is on xx.com deployed and your "API" does not have a list of allowed domains enabled or the ability to allow all.您的引导 vue 在 xx.com 上部署,并且您的“API”没有启用的允许域列表或允许所有域的能力。
In short, your "API" does not allow requests from xx.com.简而言之,您的“API”不允许来自 xx.com 的请求。 You must enable it.
您必须启用它。
More information: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS更多信息: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.