You can embed fragments of JavaScript inside Java applets although there are some limitations to what you can accomplish with this. For this to work, Java and JavaScript both have to be enabled and working. This may require some preference setting. Currently, it only works in Netscape.
The <APPLET> tag is the main way to embed a Java applet within an HTML document. That much generally works across all browsers.
JavaScript scripts should always have access to all the internals of a Java applet that it cares to make publicly available. However, the converse is not necessarily true. Java applets may not access the script-owned object space unless you give them permission to do so.
This is done with the MAYSCRIPT tag attribute on the <APPLET> tag.
The Java applet can then mimic JavaScript methods using the Java syntax, and there are mechanisms for accessing eval() functionality for interpreting JavaScript source text.
See also: | Java, Java exception events, JSObject object, MAYSCRIPT |
Prev | Home | Next |
JavaScript Document Source URL | Up | JavaScript entity |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |