Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Javascript-Java
- From: vaiism@xxxxxxxxxxx (Robert B. Weeks)
- Subject: Javascript-Java
- Date: Fri, 29 Oct 1999 22:08:22 -0700
Hello -
> Also, here is the cde where i am calling the java fn from javascript. I
> tried using Applet instead of JApplet but it doesn;t work("object oes not
> support property/method" error). It works fine if the base class is applet.
> Any help here would be appreciated.
> Raaj.
>
>
> HTML code
>
> <HTML>
> <HEAD>
> <TITLE>Autogenerated HTML</TITLE>
> <SCRIPT LANGUAGE="JavaScript">
> <!--
> function someFunc()
> {
> alert()
> document.applets.oneapplet.SomeFunc()
> }
> file://-->
> </SCRIPT>
>
> </HEAD>
> <BODY onLoad="javascript:someFunc()">
> <APPLET name = "oneapplet" CODE="Applet1.class" WIDTH=426
> HEIGHT=266></APPLET>
> </BODY>
> </HTML>
Have you tried using the applets array instead of the applets. ?
document.applets['oneapplet'].myMethod();
or
document.applets[0].mymethod();
Also make sure that you have MAYSCRIPT in your applet tag as well:
<APPLET
name = "oneapplet"
CODE="Applet1.class"
WIDTH=426
HEIGHT=266
MAYSCRIPT>
</APPLET>
Hope this is what you were looking for...
Also - you don't need the term 'javascript:' on the onload - it is just like
any other event - just call the function:
<body onLoad="someFunction();">
--
Robert B. Weeks Software Engineer
Sun Microsystems, Solaris Phone: 1.650.786.4276
901 San Antonio Rd. UMPK17-304 rweeks@xxxxxxxxxxx
Palo Alto, CA 94043 vaiism@xxxxxxxxxx
---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Follow-Ups:
- Javascript-Java
- From: Rajendra Mishra
- Javascript-Java
- References:
- Javascript-Java
- From: Rajendra Mishra
- Javascript-Java
- Prev by Date: classloader
- Next by Date: JEditorPane class
- Previous by thread: Javascript-Java
- Next by thread: Javascript-Java
- Index(es):