X

Sundararajan's Weblog

  • Java
    November 10, 2006

Applet-JAX and scripting

Guest Author
I came across Chet Hasse's blog entry titled "Applet-JAX ". In the code, he uses Java-to-Javascript Communication. If you are going to use JDK 6, then you can use scripting API (javax.script) to access browser's (native) JavaScript script engine. JSR-223 script engine for browser's JS interpreter is available at https://scripting.dev.java.net/. With JDK 6, Rhino based JSR-223 engine is included as well. There is also scriptlet applet to write applets in JavaScript.

Join the discussion

Comments ( 3 )
  • mike Monday, November 13, 2006
    "use scripting API (javax.script) to access browser's (native) JavaScript script engine" . Really ?
    could you give some example code ? I know we can use Common DOM API or JSObject to access browser DOM ? Do you mean javax.script can do that ?
  • A. Sundararajan Monday, November 13, 2006
    Yes, you can access browser's native JS interpreter through javax.script API. This jsr-223 engine uses JSObject API. Because of that this engine can only be used inside applets. There is a simple applet in CVS [$scripting/engines/src/example/HelloScript.java]
  • A. Sundararajan Monday, November 13, 2006
    Sorry the file is $scripting/engines/browserjs/src/example/HelloScript.java
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.