2

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

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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 .
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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.