/    Sign up×
Community /Pin to ProfileBookmark

How to tell whether an applet loaded properly?

I’ve got a page that has frames, and one of the frames has a Java applet (ProScroll.class) that is used to scroll text that is read from a file on a server. Sort of a “CNN scrolling headlines”. ProScroll got picked because it would read from an external file. Since I want updates to appear, I have a meta-tag refresh that reloads the page containing the applet at a set interval.

Usually things are OK, but in some cases, the applet doesn’t initialize properly and I end up with a gray bar instead of my scrolling text.

Is there any way to have some Javascript that can tell whether the applet loaded properly, and if it didn’t, try to refresh the page or do something to fix things?

This has to work for a generic applet – I don’t have control over the applet being used all the time.

Thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Daniel_TFeb 13.2004 — u can use an onload function, that redirects the user to a page without the scrollbar if the user does not have java enabled. i dont, however, know how many browsers are compatible with this script. also, they will need to have javascript enabled for it to work. here's the code, just incase it comes in handy:
[code=php]
<SCRIPT>
function checkjava()
{

if (navigator.javaEnabled() < 1){
window.href="noscrollbarpage.html";
}

}

</SCRIPT>
[/code]

and, the body code:
[code=php]
<body onload="checkJava();">
[/code]


hope this helps,

-Dan
Copy linkTweet thisAlerts:
@GuyWithDogsauthorFeb 13.2004 — Actually, what I need to do is recognize that the applet I tried to load didn't load properly. Java is enabled; what I'm seeing is that a "refresh" on the frame (caused by a META tag Refresh) will sometimes end up with the applet not initialized properly. So we get a big gray bar where the applet should be.

What I'm hoping to do is find some way of querying the applet for some property (perhaps a PARAM I specify) that will not be set when the applet doesn't load properly.

Testing this will be a bear, too - I can't make the problem happen on demand, so I'm going to have to set it up and then "hope" that the problem happens. If it never happens, I'm not sure I fixed it, unless there's something that someone can tell me works everytime.

Thanks for the suggestions...
×

Success!

Help @GuyWithDogs 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.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...