tags:

views:

75

answers:

1

Hi All , Can you please let me know whether we can pass a Java Object from JavaScript to Applet .

A: 

No, you can't. Javascript can't make a java Object, since a java Object can only exist inside a JVM. Javascript doesn't run in a JVM. But javascript code can pass parameters (typically strings) to an applet, and you can call methods on your applet's top level class.

The best place to start is Sun's documentation. There's more description here, and an example here.

John
Hi John Thanks for the reply , I request you for more Info . I mean can i pass any object (may be not of java ie may be from DB) from Java Script to Java .
Kamal
If your javascript can describe the object as strings, then yes. For example, if your object is a person with a firstname and a lastname, then you could call a java method setPerson(firstname,lastname).
John