Hi All, Does anyone know of were I might find a javascript that will detect whether the viewer has Java installed and active, then if not possibly pop up a message box telling them so and give advice on where to get it?? Thanks E ?
@age13kidJan 13.2005 — #hello. i was reading your problem and i came across a soulution( if you havnt already found one ). this both detect if java is enabled and if javascript is not enabled with a <noscript> tag...
<i> </i><html> <head>
<i> </i><title>Untitled</title>
</head>
<body> <script language="Javascript" type="text/javascript"> if(!navigator.javaEnabled()){ alert('Enable your java to expirience this java enhanced page orn try install it...'); location.replace('http://java.sun.com'); } else{ } </script> <noscript> Please enable javascript or get a new browser. </noscript> <br/> yay you have both java AND javascript enabled! =)
</body> </html>
of course you might want to change that around a bit but thats basicly it =)
@epocauthorJan 13.2005 — #Hello and thank-you for your prompt replies. I guess I should have also explained my lack of knowledge of javascript. age13kid or anyone else, could you possibly explain how I might use the code you supplied to, if no java installed/enabled, another browser window may open with instructions. If Java installed/enabled, then nothing happens and the page continues to load the java applet.
@JPnycJan 13.2005 — #You'll 1st need to know if javascript is enabled. Build a page with no JS that says "Javascript and Java must be enabled to view this site". Then a JS redirect to the page with the JS function (if they have it enabled). There you can test for java, and redirect to sun if they don't. So you'll actually need 3 pages to do this right.
@age13kidJan 13.2005 — #yup the code that i posted earlier will do the same thing by changing it around a bit... <i> </i><body> <script language="Javascript" type="text/javascript"> if(!navigator.javaEnabled()){ alert('Enable your java to expeirience this java enhanced page orn try install it...'); location.replace('http://java.sun.com'); window.open('instructionsforintallingjava.html'); } else{ document.write('<applet watever></applet>'); } </script> <noscript> Enabled javascript please </noscript> </body>
and JPnyc you really dont need all those webpages for testing to see if javascript and java is installed/enabled
@epocauthorJan 13.2005 — #Thanks a heap for all your help. I think I am getting very close to what I need. Firstly, how do I disable Java for testing?? Secondly, here is my [URL=http://www.thedvdco.com/detect_java/vats.html]test page[/URL] I am unsure what needs to be done to get rid of the demo applet and have mine load on the ;[COLOR=blue]document.write('<applet watever></applet>');[/COLOR] Basically, what I want to happen is: if the viewer has Java, my panorama loads normally. If they don't have Java installed/enabled then the no_java.html page opens.
@jbotJan 13.2005 — #[i]Originally posted by epoc [/i]
[B]Thanks a heap for all your help. I think I am getting very close to what I need. Firstly, how do I disable Java for testing?? [/B][/QUOTE]
this will vary from browser to browser. so, er ... use some commonsense and look up the online help for that browser. :rolleyes:
[i]Originally posted by epoc [/i]
[B]I am unsure what needs to be done to get rid of the demo applet and have mine load on the ;[COLOR=blue]document.write('<applet watever></applet>');[/COLOR] [/B][/QUOTE]
don't use the applet tag, it's deprecated, which means if you use certain doctypes within your webpage it will fail completely. instead follow [URL=http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html]SUN's advice[/URL].