Redspartan19
New member
I'm attempting to create a javascript in which it detects what browser is viewing my web page. The page seems to only work in Fire Fox, and so I want the page to only work as such. So far, I have this code.
<script type="text/javascript">
if (navigator.appCodeName = "Netscape")
{
document.write ("*starting with <body> the rest of my webpage goes here*");
}
else
{
document.write("<h1> This page does not support internet explorer. Please switch to Firefox.</h1>")
}
</script>
I'm pretty sure this is the wrong way to go about this, but I would love some help. Thanks!
<script type="text/javascript">
if (navigator.appCodeName = "Netscape")
{
document.write ("*starting with <body> the rest of my webpage goes here*");
}
else
{
document.write("<h1> This page does not support internet explorer. Please switch to Firefox.</h1>")
}
</script>
I'm pretty sure this is the wrong way to go about this, but I would love some help. Thanks!