拒绝执行内联事件处理程序,因为它违反了以下内容安全策略指令

Refused to execute inline event handler because it violates the following Content Security Policy directive: “script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ at.alicdn.com f.alicdn.com g.alicdn.com log.mmstat.com g.assets.daily.taobao.net g-assets.daily.taobao.net tce.taobao.com retcode.alicdn.com g-assets.prepub.taobao.net bim-core-prod.oss-cn-shanghai.aliyuncs.com ‘nonce-t0AOXmRYDuRMQrdp’”. Note that ‘unsafe-inline’ is ignored if either a hash or nonce value is present in the source list.

解决方案:

  1. 使用document 创建元素后,添加事件,然后插入到指定容器中,要注意,使用容器id,会造成id不唯一

你可能感兴趣的:(浏览器报错)