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

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不惟一