Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Detect browser and play sound


< SCRIPT TYPE = "text/javascript" >
<!--
var filename = "hazy_shade_of_winter.mid" ;
if (navigator.appName == "Microsoft Internet Explorer" )
   document.writeln ( '<BGSOUND SRC="' + filename + '">' );
else if (navigator.appName == "Netscape" )
   document.writeln ( '<EMBED SRC="' + filename + '" AUTOSTART=TRUE WIDTH=144 HEIGHT=60><P>' );
// -->
</ SCRIPT >
< NOSCRIPT >
< BGSOUND SRC = "hazy_shade_of_winter.mid" >
</ NOSCRIPT >