【经验】在Chrome apps中如何加载外部图片资源
在Chrome App中如果直接直接加载外部图片文件(无论是写在样式中,或是直接img标签载入,<webview>除外),都会报如下错误:
Refused to load the image 'http://xxx.jpg' because it violates the following Content Security Policy directive: "img-src ...
在Chrome App中如果直接直接加载外部图片文件(无论是写在样式中,或是直接img标签载入,<webview>除外),都会报如下错误:
Refused to load the image 'http://xxx.jpg' because it violates the following Content Security Policy directive: "img-src ...
【一】、如下片段是当晚在IE7、8及FF中测试执行成功的:
-----------------------------------------------------------------------------------------
如下代码:
var url = "http://......../image.jpg"; var img = new Image(); img.src = url...