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. Advertising

  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. Advertising

  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. Advertising

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:
    519
    Stephen Kellett
    Jan 26, 2005
  2. Oliver Wong
    Replies:
    14
    Views:
    1,612
    Chris Uppal
    Jun 13, 2006
  3. Oltmans
    Replies:
    6
    Views:
    340
    Terry Reedy
    Mar 11, 2009
  4. Rhino
    Replies:
    49
    Views:
    1,025
  5. Kenneth McDonald
    Replies:
    5
    Views:
    312
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page