JavaScript Tip of the Week for September 9, 1996: Much Ado About LiveConnect | 2 | WebReference

JavaScript Tip of the Week for September 9, 1996: Much Ado About LiveConnect | 2

JavaScript Tip of the Weekfor September 16, 1996: What is LiveConnect?

Introduced with Netscape Navigator 3.0, LiveConnect is a way of interfacing Java, JavaScript, and plug-ins so they can interact easily with one and other. Through LiveConnect, JavaScript can now access Java's methods and classes. This means that some of Java's power is given to JavaScript.

JavaScript now has the ability to access a Java applet's variables and functions. Say you have the classic 'scroller' applet on your site and you want it to display a user's name. You can have the user type their name into a form and JavaScript can relay the name to the applet and scroll it.

JavaScript can also access a LiveConnect enabled plugin's methods and functions. LiveAudio, for instance, can easily be played, stopped, paused, etc. through JavaScript. How do Java, JavaScript, and plug-ins interact with one and other? Take a look at this diagram which illustrates the interaction between the trio. (This diagram is from Netscape's LiveConnect blurb.) What we'll be dealing with in this tip is the JavaScript side of LiveConnect. More specifically calling Java's methods and classes and controlling LiveAudio.