20th December 1996

Today's tips come from Microsoft's latest Site Builder eZine
(which were taken from The Cobb Group at http://www.cobb.com/):

Q: How can I detect which browser is being used?

A: Whenever possible, you should be testing for the capabilities of the browser (for example, VBScript support) rather than identifying the browser. This will automatically handle upgraded versions of browsers. If that's not practical, you must use scripting code such as the following:

<SCRIPT LANGUAGE="JavaScript"> var ver = navigator.appVersion; if (ver.indexOf("MSIE") != -1) <confirm("Thanks for using IE")> </SCRIPT>

Q: How can I embed a sound for both Internet Explorer and Netscape Navigator?

A: Use the following code:

<EMBED src="sound.au" height=2 width=2 autostart=true hidden=true> <NOEMBED> <BGSOUND src="sound.au"> </NOEMBED>

Q: How can I prevent the colors in my page from being dithered?

A: You should only use the 216 colors in the standard palette supported by both Internet Explorer and Netscape Navigator to ensure that your page will look good on systems running in 256-color mode. These colors include any combination of red, green, and blue components of 0, 51, 102, 153, 204, and 255. Want more detailed information? Visit the Authoring/ Editing area of the Site Builder Workshop at http://www.microsoft.com/workshop/ and read the article on "Decreasing Download Time Through Effective Color Management."