Javascripts > Javascript Redirects > Detect Status And Redirect
Script Title: Detect Status And Redirect
Description: Detect a browsers version with description of forwarding messages displayed, then redirects
Example: No example available for this script.
Copy the following code into your <HEAD></HEAD> tags.<script language="JavaScript"> <!-- /* This Script Free To Use Providing This Notice Remains This Script Has Been In The http://www.DesignerWiz.com Javascript Public Archive Library NOTICE: Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply */ //activate cloak var BrowName = navigator.appName; var BrowVer = parseInt(navigator.appVersion); var DispBrow = BrowName + " " + BrowVer var browLoc = "" var SecsToWait = 15 var WaitTime = 1000 // This variable is used for example only, You need to replace it with the actual // URL in the code below.!!! var DestAddr = "detect_browser_status_direct.htm" // This is used to display a picture on the page. var ImgToShow = "../images/watermark1.gif" var AltText = "Script provided by www.DesignerWiz.com" if (BrowName == "Netscape" && BrowVer == 3) ver = "n3"; else if (BrowName == "Netscape" && BrowVer == 4) ver = "n4"; else if (BrowName == "Netscape" && BrowVer == 2) ver = "n2"; else if (BrowName == "Microsoft Internet Explorer" && BrowVer <= 3) ver = "e3"; else if (BrowName == "Microsoft Internet Explorer" && BrowVer == 4) ver = "e4"; else ver = "UnWorthy"; // If Netscape 4.0 if (ver == "n4") { browLoc = DestAddr //alert ("netscape 4.0"); } // If Netscape 3.0 if (ver == "n3") { browLoc = DestAddr } // If Netscape 2.0 if (ver == "n2") { browLoc = DestAddr } // If Internet Explorer 3.0 if (ver == "e3") { browLoc = DestAddr } // If Internet Explorer 4.0 if (ver == "e4") { browLoc = DestAddr } // if It is another browser that supports javascript. if (ver == "UnWorthy") { browLoc = DestAddr //alert("browLoc = " + browLoc); } function timer(Disp) { if (Disp == 0) { window.location.href = browLoc; return; } if (Disp == 15) { document.Countdown.EffectBox.value = "Detecting Browser Please Wait..."; } if (Disp == 13) { document.Countdown.EffectBox.value = "Browser Detected ..."; } if (Disp == 10) { document.Countdown.EffectBox.value = "Preparing for " + BrowName + "" + BrowVer; } if (Disp == 7) { document.Countdown.EffectBox.value = "Checking Destination Directory..."; } if (Disp == 4) { document.Countdown.EffectBox.value = "Preparing to transfer..."; } if (Disp == 1) { document.Countdown.EffectBox.value = "TRANSFERING NOW..."; } var time = "Transfer in "; var minute = Math.floor(Disp / SecsToWait); if (minute < 10) { time += "0"; } time += minute + ":"; var second = Disp % SecsToWait; if (second < 10) { time += "0"; } time += second ; document.Countdown.CountBox.value = time; -- Disp; var command = "timer(" + Disp + ")"; window.setTimeout(command,WaitTime); } // deactivate cloak --> </script>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email