While work was underway on SVG, Apple was doing its own thing, and the result was the
Rather than an XML-based specification, the
canvas object is just that—an object that provides a graphical “canvas” on which to create. Instead of adding separate elements, as was demonstrated with SVG earlier in this book, you create an instance of the
canvas object and then manipulate it with script to create the desired effect.
The benefit to the
canvas object is you don’t have to work with XML, nor the potentially large amounts of markup this might create in your web page. The disadvantage is that if a person accessing the page has scripting turned off—which many people do for security reasons—the
canvas effect won’t show.
canvas object lacks the sophistication of SVG, especially as we’ll see later in this book. However, it’s also a simple object to learn how to use, as this chapter will demonstrate. In addition, the
canvas object is supported for the next generation of HTML, HTML5.
There is extensive cross-browser support for the
canvas object. Safari, Opera, and Mozilla support