Talk to JavaScript
- 0
- Add a Comment
We all know that there is a huge difference between Java and Javascript, right? But did you know that with the right kind of scripting, they can actually talk to one another? It’s true, see for yourself!
Communication between JavaScript and Java applets can be made possible using something called LiveConnect. JavaScript can be used to access Java variables, classes and methods directly, and conversely Java can be used to access JavaScript methods and properties.
Enabling LiveConnect
Before Java and JavaScript can communicate at all, LiveConnect must be enabled. This is done by putting a special attribute in the (applet) element:
