Jump to content
xisto Community
Sign in to follow this  
reciter

To Call Functions Of Javascript From A Java Applet Please help me.

Recommended Posts

Hi.There is a matter to know.

 

I studied how to call the public method of a JAVA applet from javascript on the other day.(Within javascript, this is possible, if it carries out like document.applets[0]. method ();.)

I want to have come to know then suddenly,it is contrary to this,

Is it possible to call functions of javascript from a JAVA applet?

 

 

 

Please tell me this. :)

Share this post


Link to post
Share on other sites

Applets need to import netscape.javascript.* package to make calls to JavaScript. The typical form for an Applet to JavaScript call is JSObject win = JSObject.getWindow(this); String[] args = {formTextField.getText()}; Object stringObject = win.call("setFormTextEntry", args);Where setFormTextEntry is the name of a JavaScript method in the web page and args represents the parameter list for the setFormTextEntry function.

Share this post


Link to post
Share on other sites

From my experience, java script can call applet and applet can call java script, but it is better don't mix these two technology in your web site.

 

In my previous project, call from applet to java script may cause ie in windows xp home version dead lock, although all the other version work fine, including windows 98, windows 2000, windows xp professional.

 

So I believe the support of java in microsoft is not critical. You can play it, but don't consider it in your job.

 

Hi.There is a matter to know.

 

I studied how to call the public method of a JAVA applet from javascript on the other day.(Within javascript, this is possible, if it carries out like document.applets[0]. method ();.)

I want to have come to know then suddenly,it is contrary to this,

Is it possible to call functions of javascript from a JAVA applet?

Please tell me this. :P

26305[/snapback]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.