Click to See Complete Forum and Search --> : Handling browser conditions


florida
01-10-2003, 11:43 AM
How can I make conditions where if it is a Netscape brwser it gives me just a text and if it is a IE browser it gives me a link. I have this link that I want to show in my IE browsers but just show a text if in Netscape browser.

The html for for IE:
<a href="mypage.html">mypage Link</a>

HTML for netscape:
<p>mypage Link is only available in IE</p>

pyro
01-10-2003, 11:47 AM
You can use this bit of code to do that.

<script type="text/javascript">
if (navigator.appName == "Microsoft Internet Explorer")
{
document.write('<a href="mypage.html">mypage Link</a>');
}
else
{
document.write('<p>mypage Link is only available in IE</p>');
}
</script>

A much better alternative would be to make your site accessible cross-browser, though...

florida
01-13-2003, 07:44 AM
Thank you.