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.
解决方案:
- 使用document 创建元素后,添加事件,然后插入到指定容器中,要注意,使用容器id,会造成id不唯一