I tried to create canvas object with jQuery like this
this.canvas = $('<canvas/>', {
id: this.id,
width: this.width + 'px',
height: this.height + 'px'
})[0];
it created a canvas with the right size, but when I tried to draw in it, every number I entered for Y-Coordinate was doubled, and the horizontal lines were thick and blurry. Everything was fine when I chnaged the above code to
this.canvas = document.createElement('canvas');
this.canvas.id = this.id;
this.canvas.width = this.width;
this.canvas.height = this.height;
It appears strange to me so I searched in Google but didn't find anything. May be someone here has bumped into a similar problem.
Thanks in advance!