Summary
This chapter touched on the very important topic of browser support and code portability. As productive and efficient developers, we should always strive to create maintainable code. Thus, the more browsers we can support with the same code base, the more efficient we are. In order to help us achieve this goal, we can create abstractions that encapsulate code that varies from browser to browser, as well as from device to device. Another alternative is to use existing polyfills that other people have written, and thus accomplish the same thing, but with possibly less effort and more reliability.
The game we built in this chapter makes use of three HTML5 APIs, namely drag-and-drop, web audio, and SVG. Native drag-and-drop provided in HTML5 is a lot more than simply dragging DOM elements around the screen. With it we can customize a lot of the visual elements related to the drag-and-drop action, as well as specify data that is carried through the draggable element and the target where...