JavaScript calling java methods

Discussion in 'Java' started by ezhilvel@gmail.com, Mar 7, 2008.

  1. Guest

    Hi

    Is there any possibility of javascript calling java methods.. it is
    possible in case of java program using applet and even possible with
    JSP. Is it possible to get on with the usual Java classes. Let me know
    if thats possible..

    Thanks..
     
    , Mar 7, 2008
    #1
    1. Advertisements

  2. GArlington Guest

    On Mar 7, 5:57 am, wrote:
    > Hi
    >
    > Is there any possibility of javascript calling java methods.. it is
    > possible in case of java program using applet and even possible with
    > JSP. Is it possible to get on with the usual Java classes. Let me know
    > if thats possible..
    >
    > Thanks..


    Yes.
    You will have to load java class into javascript accessible DOM
    though...
     
    GArlington, Mar 7, 2008
    #2
    1. Advertisements

  3. Guest

    On Mar 7, 6:57 am, wrote:
    > Hi
    >
    > Is there any possibility of javascript calling java methods.. it is
    > possible in case of java program using applet and even possible with
    > JSP. Is it possible to get on with the usual Java classes. Let me know
    > if thats possible..
    >
    > Thanks..


    Hi!

    Yes it's possible.

    For example you has a applet with tag name="MyApplet".
    From JavaScript you can call the "public"-Method "public String
    getAnything() {...}" of the Applet with MyApplet.getAnything();

    Important: Only the public Methods of your Applet-class are callable!

    Give me feedback if it works!

    regards
    Alexa
     
    , Mar 7, 2008
    #3
  4. Arne Vajhøj Guest

    Arne Vajhøj, Mar 8, 2008
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen Kellett
    Replies:
    3
    Views:
    647
    Stephen Kellett
    Jan 26, 2005
  2. Radha News
    Replies:
    2
    Views:
    5,412
    Jim Sculley
    Feb 18, 2004
  3. Oliver Wong
    Replies:
    14
    Views:
    1,984
    Chris Uppal
    Jun 13, 2006
  4. Klaus Friese

    c++ calling java calling c++ ...

    Klaus Friese, Aug 12, 2005, in forum: C++
    Replies:
    7
    Views:
    872
    Roland Pibinger
    Aug 15, 2005
  5. Cal
    Replies:
    4
    Views:
    485
    Roedy Green
    Feb 27, 2009
  6. Oltmans
    Replies:
    6
    Views:
    632
    Terry Reedy
    Mar 11, 2009
  7. Rhino
    Replies:
    49
    Views:
    1,366
  8. Kenneth McDonald
    Replies:
    5
    Views:
    662
    Kenneth McDonald
    Sep 26, 2008
Loading...