• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Using Java with JavaScript > Scripting Java Applets

22.1. Scripting Java Applets

As discussed in Chapter 14, all Java applets embedded in a web page become part of the Document.applets[] array. Also, if given a name or id, an applet can be accessed directly as a property of the Document object. For example, the applet created by an <applet> tag with a name attribute of "chart" can be referred to as document.chart.

The public fields and methods of every applet are accessible to JavaScript as if they were the properties and methods of a JavaScript object. For example, if an applet named "chart" defines a field named lineColor whose type is String, a JavaScript program can query and set this field with code like this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint