gpt4 book ai didi

html - crossorigin 属性的目的...?

转载 作者:技术小花猫 更新时间:2023-10-29 11:30:47 26 4
gpt4 key购买 nike

在图像和脚本标签中。

我的理解是您可以访问其他域上的脚本和图像。那么什么时候使用这个属性呢?

这是您想限制其他人访问您的脚本和图像的能力吗?

图片:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-crossorigin

脚本:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script

最佳答案

答案可以在the specification中找到.

对于 img :

The crossorigin attribute is a CORS settings attribute. Its purpose is to allow images from third-party sites that allow cross-origin access to be used with canvas.

script :

The crossorigin attribute is a CORS settings attribute. It controls, for scripts that are obtained from other origins, whether error information will be exposed.

关于html - crossorigin 属性的目的...?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18336789/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com