how to call function in Java?

Can javascript link with normal java code?

  • I need to code a software that runs on web browsers such as, chrome, ff, IE, safari I know how to code in java.. So can java script link with the normal java code? - for example: can we call a function from the original java code to the java script? (using classes from java code in the java script?) Or is there any program that can link java code to the web browser? Or any suggestion? THX!

  • Answer:

    You have a jsp page (or servlet) or an applet. If you have a jsp page (or servlet) you can't do that. If you have an applet you can call javascript functions from the java code and you can call java methods from the javascript code. Example page doing both things: http://www.raditha.com/java/mayscript.php One last thing: If you have JSP but want to mix in javascript code (that is only executed on the server) you can use this: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/scripting/

Alvin at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Instead of trying to connect java to javascript why dont you learn javascript from scratch. If you know how to code in java, learning javascript will be a quick whiz for you. check this site for a great tutorial. http://www.w3schools.com/js/default.asp believe me, javascript is an extremely easy language. the first programming language i learnt was javascript and i learnt about most of it in a week.(i was a total noob back then!) Im sure you'll manage it in a day.

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.