There are few problems in the code. First correct them.
1. function GetImage() should return
imageArray
instead of
canvas
.
2. Use array like this.
var imageArray = new Array();
3.
imageArray[imageArray.length]
- What is the
imageArray.length
???
4.
var context = canvas .getContext("2d");
imageArray[imageArray.length] = canvas .toDataURL()
Extra spaces are there after the selectors.
it should be
var context = canvas.getContext("2d");
imageArray[imageArray.length] = canvas.toDataURL()
5.
context
is declared, but not used.
6.
htmlDiv
,
postData
not defined.