我将图像托管在服务器上,而 KineticJS 应用程序在另一台服务器上运行。
问题:尝试时stage.toDataURL()
,我收到 CORS 错误:
Uncaught Error: SECURITY_ERR: DOM Exception 18
我已调整 Apache 以允许 CORS
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
Header set Access-Control-Allow-Methods "GET, PUT, POST, DELETE"
当图像卷曲时,我得到
HTTP/1.1 200 OK
Date: Sat, 26 Jan 2013 21:29:35 GMT
Server: Apache
Last-Modified: Sat, 26 Jan 2013 21:27:19 GMT
Accept-Ranges: bytes
Content-Length: 166812
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET, PUT, POST, DELETE
Content-Type: image/jpeg
但是SECURITY_ERR
错误仍然发生!
是否需要执行另一个步骤来.toDataURL()
处理来自另一个域的图像,可能使用跨域标签?