faqts : Computers : Programming : Languages : JavaScript : Applets/Java

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

how to check if applet is loaded

Jul 25th, 2008 11:31
Paul Hriz, http://www.rgagnon.com/javadetails/java-0176.html


I just changed the code a little so that it will not consume() all
document errors, and would still work!

My function need the object passed, but this is easy to change as you
see fit.
Here is my function:

function isLoaded(obj) {
	if(!obj) return false;
	try {
		if (!obj.isActive)
			// in IE: isActive returns an error if the applet IS loaded, 
			// false if not loaded
			// in NS: isActive returns true if loaded, an error if not loaded, 
			// so never reaches the next statement
			return false;
    }
	catch(e){return false;}
	
	return true;
}