firefox - Determine whether client browser has java installed and can launch applets -


I am developing an .aspx page which will eventually launch an applet after the user clicks on a button (I tag) Therefore, I have to find out that Java's capability / user has been installed on the browser.

I am using the navigator.javaEnabled () method. However, although it is working fine on IE 7, but it is returning inconsistent results on Firefox 3.0.12 (do not know about different browsers), sometimes it is saying that Java is enabled (which That's it), and then after the Applet launch and coming back to this page from the applet, it will report incorrectly if I turn off Firefox and return to the applet launch page, Navigator.Javainated () again From to Mr. (right) will report.

Is there anything that is determining this incompatible behavior or navigator. Java is enabled ()

Make a method in your applet

  isRunning public boolean () {back is true; }  

Now create an applet:

  & lt; Applet src = "... / yourapplet.jar" id = "someId" & gt;  

And now wrap this code in some helpful functions

  try {var x = document.getElementById ('someId'). IsRunning () return x; } Hold (e) {return false; }  

Why does this work? If the applet moves, then it will come true. If the applet is not running or Java is not supported you will get an exception, so you will get a lie.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -