Chapter 23. Scripting Plugins

A plugin is a third-party component that can embed itself inside a browser. A lot of browser plugins have JavaScript APIs so that developers can control their behavior inside a page. Not all plugins have a Graphical User Interface (GUI). Sometimes all you might want from a plugin is a small piece of functionality for doing something simple like playing a sound or uploading a file. At other times, plugins feature prominently in web applications like the Flash player on YouTube.

There's a lot of great functionality inside a modern browser, but not everything you want to do is possible or supported natively by enough browsers to be useful. One could argue that maybe browsers shouldn't do everything. Functionality like animation, gaming, and video might best be handled by the rich plugin architecture built into browsers like Firefox and Internet Explorer. Whatever side of the fence you sit on, it's undeniable that plugins add a lot to the browsing experience.

In this chapter I'm going to introduce four different plugins: Java Applets, Flash, Silverlight, and Quicktime. In the case of Java, Flash, and Silverlight, a certain level of competency is expected with those technologies to begin using them as a plugin. This chapter will not teach you a lot about how to program in Java, AS3 (Flash), or C# (Silverlight), but it will focus on how to communicate with these plugins via JavaScript should the need arise.

Java Applets

Applets were introduced back in 1995 along ...

Get JavaScript® Programmer's Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.