سؤال

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.

هل كانت مفيدة؟

المحلول 3

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.

نصائح أخرى

See my answer I gave here. It is not exactly what what you wanted, but you might wait in your Applet until a method is called.
Hope it helps!

From my ..scan of the problem description, given you failed to ask a question I will presume one.

Have a 'hidden applet' the check for the ability to do ..whatever, and on failure, call a script that says/stores 'no'. That script might then communicate with the applet to let it know how to appear, or what to do.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top