I have a POS web application which currently executes a java applet on page load. I don't want the java applet to be loaded on any computer that doesn't have the display pole for which it was made. The easiest way I can think of to get around this is to have the element disabled and re-enable it via javascript if a variable is "true". The javascript should be given a global variable somehow, which will let it know to activate the applet.
The question therefore is: Is there a way to set a global javascript variable from within the browser or OS? I originally wanted to use system variables but that apparently requires ActiveX controls.
So a workable solution was to run the applet and have the applet check the name of the computer (http://bytes.com/topic/java/answers/699529-get-host-name-run-applet). After I have that, I had the applet close itself (System.exit(0)
) and that pretty much solves any issues of hanging applets over a long period of time. It doesn't solve the issue completely but it's a good place to be in for now.