PDA

View Full Version : Handling different browsers


florida
10-25-2002, 07:43 PM
please assist as I am trying to put a javascript to handle Netscape 4.77 browser and IE browser.
If I use IE I want to use the regular HTML href mailto as seen below. But if I am on a Netscape 4.77 browser I want to connect to another mail form page. Any suggestions on how I can do this.
I did try below but it doesnt work:

<script name="JavaScript">
NS4=(document.layers);

if(!NS4)
{
<p align=center><font size="-1">Point of Contact
<a href="mailto:myname@me.com">myname@me.com</a> </p>
</p>
}
else
{
<p align="center"><a href="http://mypage/emailform.cgi">My Mail Form</a></p>
}
</script>

beetle
10-25-2002, 09:12 PM
Surely you meant to write those HTML lines to the page, correct?

if(!NS4)
{
document.write('<p align=center><font size="-1">Point of Contact ');
document.write('<a href="mailto:myname@me.com">myname@me.com</a></font>');
document.write('</p>');
}
else
{
document.write('<p align="center"><a href="http://mypage/emailform.cgi">My Mail Form</a></p>');
}
</script>

whammy
10-27-2002, 02:48 AM
Actually, in most cases I would use the mailform page, since "mailto:" links aren't reliable.