File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to call Javascript function from an Application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to call Javascript function from an Application." Watch "How to call Javascript function from an Application." New topic
Author

How to call Javascript function from an Application.

Padma Malladi
Greenhorn

Joined: Jun 14, 2001
Posts: 7
Hi,
I have an application written in Java, which needs to call a Javascript function to execute some part of the code written in that function. Can I do this ?? If so, please let me know how I can call this javascript function from my application code. Thank You.
Padma Malladi
parind poi
Greenhorn

Joined: Jun 19, 2001
Posts: 9
JavaScript is a scripting language typically used for client side scripting (server side also) on the browser. It requires a javascript script engine. I don't know if JNI supports this, but even if it does, i would suggest you to rewrite the function in Java (should be a piece of cake since both of them are very similar in syntax). This will avoid some inter process calls too.
Parind
Padma Malladi
Greenhorn

Joined: Jun 14, 2001
Posts: 7
No, it kindof not possible to convert this function to java. I was hoping there is something similar to JNI or even JNI which would let me do this. Thank You.
Padma
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call Javascript function from an Application.