[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto java script

Larry Bloom wrote:
> I am working on a javascript that will check to see if they have
> netscape 2.0 and go to a pictular page if they do. Can't seem to get it
> to work can anone help on this...
> --
> Larry Bloom                     Voice (810) 644-5153
> Software Magic, Inc.            Fax   (810) 644-5842
> Birmingham, MI 48009            email: lbloom@software-magic.com
> --------------------------------------------------------------------Well you should try to work with the NAVIGATOR propreties.

Ex: navigator is an javascript object

and navigator propreties are: appCodeName,appName,appVersion and 

so for example you could use:

navigator.appCodeName = "Mozilla" (wich is Netscape)
navigator.appName = "Netscape"
navigator.appVersion = "2.0 (Win16, I)"
	2.0 is version number
	Win16 is Windows 3.1 version
	I stands for international version
navigator.userAgent = "Mozilla/2.0 (Win16; I)"

so you could incorporate something like this in a if .. else condition to 
reject any further use of javascript if the incorrect version is used.

	if (navigator.userAgent ! "Mozilla/2.0 (Win16; I)"){
		document.write("sorry, this page works only with Netscape 
2.0 for Windows 3.1);

or something like that. take a look at the Javascript docs at Netscape 
for more info on the NAVIGATOR object.

Christian Lanctot
e-mail: kristian@generation.net
Web   : http://www.generation.net/~kristian/
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/