Multi-Line JavaScript Strings

Adding a backslash at the end of each line tells the JavaScript engine that the string will continue to the next line, thus avoiding the automatic semicolon insertion annoyance.


Convert canvas to an image with JavaScript

Assuming modifications to the image have been made, you can easily convert the canvas data to image data with the following snippet. The code above magically converts the canvas to a PNG data URI!