I am using WordPress and project root directory is undersubdirectory, i.e http:localhost/prjctroot/project.
var oCanvas = document.getElementById("image1");
var canvasData = oCanvas.toDataURL("image/png");
Getting this error in Firebug:
Security error
var canvasData = oCanvas.toDataURL("image/png");
Same code works on other test file (not using any CMS just a simple file code for test).
I think some thing is wrong with WordPress.
Can anyone help?
Check your image source domain. It must match the document domain to get image data like that.
See http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#security-with-canvas-elements