javascript - 在脚本标签中 react 跨域

标签 javascript html reactjs

为什么在包含 React 脚本时使用关键字 crossorigin ?

如果我们不使用它会发生什么?

<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

最佳答案

crossorigin
Normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard CORS checks. To allow error logging for sites which use a separate domain for static media, use this attribute. See CORS settings attributes for a more descriptive explanation of the valid arguments.

MDN

关于javascript - 在脚本标签中 react 跨域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47103818/

相关文章:

javascript - 在外部点击时禁用关闭模式

html - 在 html 电子邮件中调整大小时使图像适合单元格

php - 单击提交按钮时,保留并传递在 javascript 中创建的动态生成的 html 表到 php

html - CSS边框问题

javascript - 即使父状态更新后,子无状态功能组件也不会更新

javascript - 拆分字符串数组以查找和选中复选框

javascript - 是否可以为我站点上的所有 jQuery 验证使用站点范围的默认设置?

javascript - Firefox 中禁用元素的标题属性

javascript - Typescript 错误 "Property does not exist on type ' JSX.IntrinsicElements'"使用 native Web 组件时

reactjs - 如何在react中强制dom重新渲染