Solved

Applet Loaded???

Posted on 1998-05-07
2
494 Views
Last Modified: 2010-05-18
How does one detect if an applet is loaded when a user clicks a button so that the 'Applet not loaded' error does not appear?
0
Comment
Question by:spivey042698
2 Comments
 
LVL 3

Expert Comment

by:percyn
ID: 1277512
One way is to not display the buttons (in your applet) until the applet is completely loaded.
0
 
LVL 10

Accepted Solution

by:
kollegov earned 50 total points
ID: 1277513
Nope, percyn, problem is in attempt to call applet methods
before applet actually loaded. As applet can continue loading after page itself loaded, you can't call it's methods before
applet will be completly loaded, this causes errors.

Unfortunatly, there is no good solution for this.
But I partitioally solved this problem with MY OWN applets.
you will find some examples in 'Between' section of my site
at http://www.geocities.com/siliconvalley/lakes/8620

Well the Idea is following:
in applet I have boolean variable
boolean isReady=false;
at the end of
applet init() method I set it to true;
After this checking in JavaScript looks so:
(reader is applet NAME attribute)

if(document.reader)
   {if(document.reader.ready)
     {if(document.reader.ready==true)
       { //Do here what you need
         //........
       }
     }  
   }

Well, you see this suppose that you write applet in this way.
If you do not make applet yourself, and use some 'ready' one as is, you can try to find some public variable in this applet which
initialized in init() method and use this variable using same
way.

You will find this example working in my
filereader applet.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now