报错信息 read.PHP:1 Refused to run the javascript URL because it violates the following Content Security
read.PHP:1 Refused to run the javascript URL because it violates the following Content Security Policy directive: “script-src ‘self’”. Either the ‘unsafe-inline’ keyWord, a hash (‘sha256-…’), or a nonce (‘nonce-…’) is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the ‘unsafe-hashes’ keyword is present.
拒绝运行JavaScript URL,因为它违反了以下内容安全策略指令:“script-src ‘self’”。要启用内联执行,需要使用’unsafe-inline’关键字、hash (‘sha256-…’)或nonce (‘nonce-…’)。注意,哈希值不适用于事件处理程序、样式属性和javascript:导航,除非有’unsafe-hash '关键字。
在header方法中增加unsafe-inline
header("Content-Security-Policy: script-src 'self' 'unsafe-inline';);
--结束END--
本文标题: html+php内联执行JavaScript是报错
本文链接: https://lsjlt.com/news/401098.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0