php - How to display message when Java applet fails to load?

Solution:
Ok, I've figure out how to do this, using AndrewThompson suggestion, that using JS doesn't need any interacion.
Here is result to my code, figured out from this website: http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/ensuringJRE.html
<script type="text/javascript" src="http://java.com/js/deployJava.js"></script>
<script type="text/javascript">
if (deployJava.versionCheck("1.7.0_0+") == false) {
userInput = confirm(
"You need the latest Java(TM) Runtime Environment. " +
"Would you like to update now?");
if (userInput == true) {
window.location = "http://java.com/en/download/testjava.jsp";
}
}
else
{
// This are just the sample parameters for now!
var attributes = {id:"applet", name:"TheApplet", code:"TheApplet"};
var parameters = {jnlp_href: "http://localhost/TheApplet.jnlp"};
deployJava.runApplet(attributes, parameters, "1.7.0_0");
}
</script>
Answer
Solution:
Maybe it is not enought, but at the moment I think that you can use the alt attribute of the tag apple:
<applet code="MyPackage/MainClass.class" archive="applet/MyJar.jar" width="790" height="900" alt="alternative text">
</applet>
Reading a little bit more in the documentation, you have the onerror event that maybe you can use, but i have never used it.
Answer
Solution:
Try this :
<SCRIPT LANGUAGE="JavaScript">
error= errr;
function loadApplet() {
if (!document.applets[0].isActive)
alert(" Applet could not be loaded");
}
function errr() {
alert("Applet could not be loaded");
}
}
add loadApplet method in body onload event
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: uncaught error: call to undefined function mysqli_connect()
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.