We accept safe and secure Credit Card and PayPal Payments.
Perl Scripts

All Count
Attachment Mailer
Perl Scripts Build A FAQ Plus
Perl Scripts Clock In Center
eBackup Automated
Easy Poll
Fetch a File
Form Maker
Mailing List Server
MySQL Mate
PDF Creation
Quick Fix
Quote of the day
Speed Search
Task Manager
Traffic Pack
Upload Plus
Upload Gold
Upload Pro
Website Manager

Free Perl Downloads

Free Perl Scripts Main Page
Free Perl Scripts 404 Alerter
AccessLog Viewer
Build A FAQ
PHP Scripts eBackup
Free PHP Scripts ErrorLog Viewer
eVars - Server Info
HT Pass Creator
Upload Lite
Website Manager


Free Java Scripts Alert Boxes
Free JavaScripts Browser Sniffer
Check email
Slide Show
Window Maker

Extra Utilities

ASP Scripts Ascii Codes
Free ASP Scripts Color Picker
Font Finder
HT Pass Creator
Meta Cloak
Meta Magic
Pano Zooms
Server Size

Online Tutorials

Free HTML Scripts Glossary
Free HTML Scripts HTML
Build Traffic


About Us
Latest versions

Hawk Eye in Tennis

Should Hawk Eye replace linesmen and lineswomen at all tennis tournaments?

View all Polls

Run Polls on your site

Run your own Surveys

Store Download FAQs Contact Us Support Programming Policies  
JavaScripts :: Miscellaneous :: Browser Sniffer.

Browser detection made easy. The scripts below will detect Internet Explorer 6, Netscape 6, Firefox, Safari 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. To see what the UserAgent object returns, use this case sensitive code:


// -->

Use this script to determine browser type. Note that IE5 is also IE6

// Browser sniffer. Written by PerlScriptsJavaScripts.com

ua   = navigator.userAgent.toLowerCase();
ie6  = (ua.indexOf("msie") && document.all && ua.indexOf("netscape") == -1);
nnf  = (ua.indexOf("netscape")  != -1 && ua.indexOf("gecko") != -1);
nni  = (ua.indexOf("netscape")  != -1 && ua.indexOf("msie") != -1);
nn6  = (ua.indexOf("netscape")  != -1);
gek  = (ua.indexOf("gecko")     != -1);
ff1  = (ua.indexOf("firefox")   != -1);
opr  = (ua.indexOf("opera")     != -1);
mac  = (ua.indexOf("mac")       != -1);
web  = (ua.indexOf("webtv")     != -1);
saf  = (ua.indexOf("safari")    != -1);
kon  = (ua.indexOf("konqueror") != -1);
nn4  = (document.layers);

// -->

Select All   De-select

Use this code to perform actions based on browser type.

if(opr){ // do this
    alert("You are using Opera");
if(ie6){ // do this
    alert("You are using Internet Explorer 6 or higher");
if(nn6){ // do this
    alert("You are using Netscape 6");
if(saf){ // do this
    alert("You are using Safari");
if(ff1){ // do this
    alert("You are using Firefox");
if(mac){ // do this
    alert("You are using a Macintosh OS");

// -->
Select All   De-select
Speed Search our site
Linux Hosting Plans from $9.12 per month, includes Plesk Control Panel, MySQL databases, cgi-bin, crontab manager and 50 email accounts.

Survey Software
Create unlimited web based surveys on your website from your website

Discounted Scripts
Subscribe to our periodial newsletter to receive special offers.

Bathroom Hygiene
How often do you thoroughly clean your bathroom?

View all Polls

Run Polls just like this one on your website!

About us | Contact us | Script FAQs | Script Support | Website Hosting | Our Policies | Store | Testimonials
Subscribers log in here. Subscribe to our periodical newsletter for special offers on commercial scripts, hosting, exciting business opportunities, and industry news and events. Our Mailing List Software is powered by Consolidator    
HTML Plain text
©1999 - 2015 All content Copyright PerlScriptsJavaScripts.com Proudly hosted by LinuxHostingPlans.com