SVG and ECMAScript

In this book, I have focused primarily on what SVG is capable of: using the declarative XML-compliant syntax alone. However, a huge area for potential development is the combination of ECMAScript (JavaScript) with SVG to produce animations or programmatic interactivity that SVG is incapable of producing alone.

JavaScript can dynamically alter characteristics of an SVG document by altering the Document Object Model, or DOM, for the document. In addition to allowing you to produce animations that closely resemble those produced using the SVG animation elements, you can create powerful interactions that declarative SVG cannot produce.

One useful tutorial site on using JavaScript with SVG is at http://www.kevlindev.com.

Get Designing SVG Web Graphics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.