Click to See Complete Forum and Search --> : Script Request & Help


stormrevolution
05-18-2003, 03:09 PM
Just wondering if there is a script which can detect a java plugin, also that can detect what browser the person is using and also grab there IP address.

Also i was wondering if the script could show the results

example:

Browser: Internet Explorer
Plugins: Java
Your IP: ***.***.***.***

and then display a button which they can click to enter my websites, i dont want a auto re-direct. Cheers all! ;)

brendandonhue
05-18-2003, 03:24 PM
With javascript, you can not see the info. THey can though.

This will get their browser and tell if java is enabled.
<script language="javascript">
document.write(navigator.appName)'
if (navigator.javaEnabled() == true)
{document.write("Java Enabled")}
else {document.write("Java Disabled")}
</script>

Their is a way for IP but I dont remember it.

stormrevolution
05-18-2003, 03:32 PM
Dosnt work for some reason, keep getting the following error:

unterminated string

brendandonhue
05-18-2003, 03:34 PM
I just made a typo
<script language="javascript">
document.write(navigator.appName)
document.write("<br>")
if (navigator.javaEnabled() == true)
{document.write("Java Enabled")}
else {document.write("Java Disabled")}
</script>

stormrevolution
05-18-2003, 04:02 PM
cheers for that,

also wondering if there is a way of putting a link button on my page and if java is enabled then the link button will be active for the user to click so they can enter and if java is disabled the button is disabled so they cannot enter?

brendandonhue
05-18-2003, 04:12 PM
Yup.
<script language="javascript">
function enabled()
{
document.write("<a href='http://yahoo.com'>Enter</a>")
}
function disabled()
{
document.write("You must enable java to view this site")
}
if (navigator.javaEnabled() == true)
{enabled()}
else {disabled()}
</script>

stormrevolution
05-18-2003, 04:29 PM
is there anyway i can make that into a button and not text and if so how would i do that?