Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call Javascript function from an Application.

 
Padma Malladi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic