Topic: Does this work? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10639" title="Pages that link to Topic: Does this work? (Page 1 of 1)" rel="nofollow" >Topic: Does this work? <span class="small">(Page 1 of 1)</span>\

 
Dark
Neurotic (0) Inmate
Newly admitted Neurotic (0) Inmate
Newly admitted
posted posted 12-03-2001 23:51

Does this work as a good browser redirect? I don't have shitscape to test this with.

code:
<script>

var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 4+
if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("http://www.directme.com")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
window.location.replace("http://directme.com")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://directme.com"
</script>



Of cource "Directme.com" will be something else ..

[This message has been edited by Dark (edited 12-06-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 12-04-2001 05:50

That script will only handle NS4 (not Mozilla/NS6) and all versions of IE4 or later... The following script detects Mozilla/NS6, Opera, NS4 & IE4+

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!-- ;

// Written by mr.maX, http://www.maxworld.co.yu/

user_agent = navigator.userAgent.toLowerCase();

isMozilla = (user_agent.indexOf("gecko") >= 0) ? 1 : 0;
isOpera = (user_agent.indexOf("opera") >= 0) ? 1 : 0;
isNS4 = (document.layers) ? 1 : 0;
isIE = (document.all && !isOpera && (user_agent.indexOf("msie") >= 0)) ? 1 : 0;

// -->
</SCRIPT>


Dark
Neurotic (0) Inmate
Newly admitted Neurotic (0) Inmate
Newly admitted
posted posted 12-04-2001 20:02

Hey sweet!
Thanks Max, much better

Is there anyway to add a redirect for screen resolution with that? Like both functions in one package?
<B>
<script language="JavaScript1.2">
<!--

if (screen.width==640



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu