Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

communication between applet and javascript

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using applet in a jsp through applet tag.now i want to invoke the java script of the web page through applet,which i m trying with JSObject,
but I m doing my application in WSAD5.0 ,where i dont have the library for netscape.javascript.*; .so where do i get ths library ?
and this JSObject will work for all the type of browsers ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The classes are executed on the client, so the fact that WebSphere does not have these classes doesn't matter. They are part of the Java Plugin, so they are in the browser where the applet runs. As long as the Sun Java Plugin is installed, this should with all current browsers.

In my JDK installation they are in a file called "plugin.jar" in the directory jre/lib.
 
anil kumar N
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ULF ,after importing plugin.jar into WSAD ,i m able to import netscape.

I have doubt. Now I am embeding applet in a jsp page,which contains java script( and i am calling this jsp through action class of struts frame work ). Let there is a button named Save on the applet.So when I press save button an action event takes place and in that method i want to call java script of the web page through Live connect (JSObject ) concept.
So in that java script can I submit the form and call action class (struts frame work ).
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This page may give you some starting points.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Anil,
you can use JSObject to call javascript, but as far as i am concerned, this would not work under firefox. What you can do is use something like
getAppletContext().showDocument(new URL("javascript:setPropertyBoolean(\"submit\",\"disabled\", false);"));
this will allow you to call any javascript function (whether it is built in or you wrote it) inside the form containing the applet. I would suggest using this script for firefox and the JSObject for IE and netscape.
As for submitting the form, surely you can do that...
simply call the document.formname.submit() javascript function, and it would do that for you
ex: getAppletContext().showDocument(new URL("javascript ocument.formname.submit();"));
Best,
Mohammad
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic