Browser detection made easy. The scripts below will detect Internet Explorer 4 and 5, Netscape 4 and 6 pre version 4 browsers and the Macintosh Platform, using the document's objects. Because Opera users can set their browser to be identified as Internet Explorer, Netscape or Opera, this script reads the UserAgent object and looks for the string "Opera". If the string "Opera" is not found in the UserAgent object, a negative one (-1) is returned. If the string is found, the character position of the string is returned. i.e. a number greater than or equal to zero (0), as zero is the position of the first character. |