webguzs
06-16-2004, 03:01 PM
I have a script that detects browsers. It works well, however I want it to detect the browser then based on the browser detected process another javascript.
here is the working syntax:
<SCRIPT LANGUAGE="JavaScript"><!--
if (navigator.appName == 'Netscape')
location.href = 'netscape.html';
else {
if (navigator.appName == 'Microsoft Internet Explorer')
location.href = 'explorer.html';
else if (navigator.appName == '*')
location.href = 'other.html';
}
//--></script>
This works to send to a web page but the location.href command doesnt work to call up a function like
<script type="text/javascript" language="JavaScript1.2" src="script.js"></script>
can someone please help?
here is the working syntax:
<SCRIPT LANGUAGE="JavaScript"><!--
if (navigator.appName == 'Netscape')
location.href = 'netscape.html';
else {
if (navigator.appName == 'Microsoft Internet Explorer')
location.href = 'explorer.html';
else if (navigator.appName == '*')
location.href = 'other.html';
}
//--></script>
This works to send to a web page but the location.href command doesnt work to call up a function like
<script type="text/javascript" language="JavaScript1.2" src="script.js"></script>
can someone please help?