My code works on Chrome but not on Firefox... in Firefox... whenever this piece of code launches..
canvas.addEventListener('keydown');
I get this error:
Not enough arguments
[Break On This Error]
canvas.addEventListener('keydown');
I have var canvas
near the top as well as this:
canvas = document.getElementById("canvas");
canvas.width = 512;
canvas.height = 352;
context = canvas.getContext("2d");
I do not know why it works fine on Chrome but not Firefox...
addEventListener
should be the callback function. See: developer.mozilla.org/en-US/docs/DOM/element.addEventListener.on