Detecting if .class is present

T

Thomas Magma

Hello,

I have a case where an applet .class file may or may not be present. In the
case when it is not present I get a big gray box where the applet is suppose
to be. This is understandable, but undesirable when someone is viewing or
printing the page. Is there a way to test first if the .class file is
present before hand in order to avoid the big gray box.

Thanks.
 
N

Nick Howes

Thomas Magma said:
Hello,

I have a case where an applet .class file may or may not be present. In the
case when it is not present I get a big gray box where the applet is suppose
to be. This is understandable, but undesirable when someone is viewing or
printing the page. Is there a way to test first if the .class file is
present before hand in order to avoid the big gray box.

If you have server scripting such as PHP you can. Probably also with
javascript but then it'd be very much dependant on whether your user had
javascript (and enabled).


http://uk2.php.net/function.file-exists

example given

<?php
$filename = 'Yourapplet.class';

if (file_exists($filename)) {
print "The Applet Code";
} else {
print "Something else friendly";
}
?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top