9ers Rule
9ers Rule

Reputation: 164

Uncaught TypeError: canvas.toDataUrl is not a function

I trying to resize an image and I am getting the uncaught TypeError message.

My code is:

var file =  canvas.toDataUrl("image/jpeg", 0.5);

Upvotes: 0

Views: 1131

Answers (1)

9ers Rule
9ers Rule

Reputation: 164

I was being lame and missed that the function name was not toDataUrl but toDataURL.

So it should be written like:

var file =  canvas.toDataURL("image/jpeg", 0.5);

Upvotes: 3

Related Questions