Closed Bug 185854 Opened 22 years ago Closed 22 years ago

Not able to call functions in applets from JavaScript

Categories

(Core Graveyard :: Java: OJI, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 115998

People

(Reporter: estauffer, Assigned: joshua.xia)

References

()

Details

(Whiteboard: redesign)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202 Pages/applet/javascript works on Windows NT with Moz 1.2.1, does not work on RedHat Linux 8.0 using Moz 1.2.1/Xft Same problem seems to be in Moz 1.1. Code did work on Moz 1.0.1/Java 1.4.0 Tested with jre/sdk 1.3.1, 1.4.0 and 1.4.1 (libjavaplugin_oji.so is properly symlinked and $JAVA_HOME set) Applets not using LiveConnect work just fine. Reproducible: Always Steps to Reproduce: 1. Load page with javascript and applet (from same site) 2. Have javascript call function in applet (using onLoad) 3. Typical js error: mngr.getOutput is not a function (where mngr is the js var for the applet) Actual Results: Java Console shows that applet loaded/started properly. No effect in browser, error message shows in javascript console. Javascript does find Applet object. Expected Results: Should have executed function call in/on applet code
---> OJI Everett: is there a URL we can use to see the problem? Thanks -
Assignee: rogerl → joshua.xia
Component: Live Connect → OJI
QA Contact: pschwartau → petersen
Summary: Not able to call functions in applets from javascript → Not able to call functions in applets from JavaScript
Everett: nice testcase! Confirming bug. I cannot reproduce the bug on WinNT using Mozilla trunk 20021204xx and Java Plug-in 1.4.1. However, I can reproduce it on Linux with a trunk build from the same date and Java Plug-in 1.4.0-b92. When I first load the test on Linux, I get these messages: In the JavaScript Console: Error: tapplet.testApplet is not a function Source File: http://chem-admin.ucsd.edu/~everett/bugzilla/bugtest.js Line: 6 In the Java Console: started (and no further message) If I now click on the test link, I get a second error in the JS Console: Error: tapplet.testit is not a function Source File: http://chem-admin.ucsd.edu/~everett/bugzilla/bugtest.js Line: 10 This seems to be a timing issue. Because if I hit "Reload", everything works without error. I get TWO messages in the Java Console this time: started testApplet called And now when I click the link, I get no errors and the test works! To be precise: I see a third message in the Java Console: testit called And in the browser, the applet prints: "The applet returned this string"
Status: UNCONFIRMED → NEW
Ever confirmed: true
Note: Bug report is for linux version. WinNT works (as I stated). I do not have any success with reloading the page. I did at first suspect a timing issue with onLoad (thought maybe the applet wasn't found.) But a quick test with an alert() showed that the onLoad handler _always_ finds the applet object, just can't call any functions. Phil- Your behavior report is identical to my experience (excepting getting it to work using a reload.) My 'real' applications are much larger, perhaps this would exacerbate the "timing" problem?
I know that at one time, Mozilla Linux OJI plug-ins communicated with an out-of-process JVM; Windows and Mac OJI plug-ins entirely in-process. I don't know if that is still true, or if it bears on this problem. I will have to let the OJI experts comment -
using onLoad to call method in Applet from javascript leads to so problem because Applet is onload, fix when redesign?
Whiteboard: redesign
dup of bug 115998 *** This bug has been marked as a duplicate of 115998 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
Duplicate of this bug: 1858255
No longer duplicate of this bug: 1858255
You need to log in before you can comment on or make changes to this bug.