/    Sign up×
Community /Pin to ProfileBookmark

can not get applet handle by javascript in firefox

I am running out of wisdom while calling applet by javascript in firefox 1.0.4. But the same code works in IE6. Any help here is greatly appreciated.

I always get the value of applet handle as null in firefox. The below is the line of code, I am calling it from another frame. And the API is the name of applet defined in jsp/html as showed at the bottom of this post.

var theApplet = parent.frames[“mscp”].document.getElementById(API);

I found the value of theApplet I got is always null in firefox, but the same code is working in IE6. I have checked the parent.frames[“mscp”].document has the valid value in firefox. And I also confirmed the applet in firefox working properly since it does generate correct logs while loading it. So, there is no issue with java environment with firefox.

I just do not know why the javascript code can not get hold of the applet in firefox, but it does in IE6.

And the below is the code where applet included in jsp, which is at frame “mscp”.

<html>
….
<body>
…….
<APPLET
CODEBASE = “./lwtapplet”
NAME = “API”
ALT = “Tracking Applet”
CODE = “LWTApplet.class”
WIDTH = “300”
HEIGHT = “400”
HSPACE = “0”
VSPACE = “0”
ALIGN = “middle”

>

<param name=”trackMode” value=”<%=trackingMode%>” />
<param name=”debugMode” value=”<%=curParam%>” />
<param name=”isVisible” value=”<%=isVisible%>” />
<param name=”userID” value=”<%=request.getRemoteUser()%>” />
<param name=”host” value=”<%=request.getServerName()%>” />
<param name=”bigDogValue” value=”<%=bigDogValue%>” />
<param name=”itrak.servlet.url” value=”<%=servletURL%>” />
&nbsp;
</APPLET>
</body>
</html>

Does any one know what is wrong here? Thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Orc_ScorcherAug 15.2005 — The method's name is getElementBy[b]Id[/b] and your applet does not have an ID. Change that or use parent.frames["mscp"].document.applets["API"].
Copy linkTweet thisAlerts:
@FeliciaLeiauthorAug 15.2005 — Thanks a lot, you are right. It is working now after I added a ID.
×

Success!

Help @FeliciaLei spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...