Text file of source used in Playing Background Music 1 (js-bgs1.htm) <HTML> <HEAD> <TITLE> Playing Background Music 1 </TITLE> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- Activate Cloaking Device //*************************************************************** // Playing Background Music 1 // by Tim Wallace (timothy@essex1.com) // // Copyright (C)1997 Timothy Wallace. All Rights Reserved. //*************************************************************** var browser_check=""; if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>=3) browser_check="n3_or_better"; if(navigator.appName.substring(0,9)=="Microsoft") browser_check="msie"; // Called by View Source button - displays text file of source. function viewSource() { alert("\nA text file with source will be loaded to the full window.\n\nUse your browser BACK button to return to the examples."); top.window.location.href="js-bgs1.txt"; } // Called by About This button function about() { msg1="This example features the following:"; msg2="- embeds player for Netscape 3 or better only"; msg3="- player is hidden"; msg4="- autostart is set to true"; msg5="- looping is set to true"; msg6="- plays song with bgsound for MSIE (loop of 10)"; alert("\n"+msg1+"\n\n "+msg2+"\n "+msg3+"\n "+msg4+"\n "+msg5+"\n\n "+msg6+"\n\n"); } // Deactivate Cloaking --> </SCRIPT> </HEAD> <BODY BGCOLOR='#00FFFF'> <CENTER><STRONG><EM> <FONT COLOR='#800000' SIZE='+3'>Playing Background Music 1</FONT> </EM></STRONG></CENTER> <BR><BR> <CENTER> <FONT COLOR=000000 SIZE="+1">Play within page automatically... no controls.</FONT> <BR><BR> <FONT COLOR=000000>Netscape 3.0 or better - infinite loop</FONT> <BR><BR> <FONT COLOR=000000>Microsoft - loop of 10</FONT> <BR><BR><BR> <FONT COLOR=000080><B>( Midi file will take a moment to load. )</B></FONT> </CENTER> <BR><BR> <CENTER><FORM> <TABLE BORDER="0" WIDTH="400"><TR> <TD ALIGN="center" WIDTH="200"> <INPUT TYPE="button" VALUE="View Source" onClick="viewSource()"> </TD><TD ALIGN="center" WIDTH="200"> <INPUT TYPE="button" VALUE=" About This " onClick="about()"> </TD></TR></TABLE> </FORM></CENTER> <BR> <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- Activate Cloaking Device if (browser_check=="n3_or_better") { document.write("<EMBED src='js-bgs1.mid' name='player' hidden=true autostart=true loop=true mastersound></EMBED>"); } if(browser_check=="msie") document.write("<bgsound src='js-bgs1.mid' loop=10>"); // Deactivate Cloaking --> </SCRIPT> <BR> <HR WIDTH=200 ALIGN=center SIZE=2> <CENTER><ADDRESS><STRONG> Playing Background Music 1<BR> by Tim Wallace <BR> timothy@essex1.com </STRONG></ADDRESS></CENTER> <HR WIDTH=200 ALIGN=center SIZE=2> </BODY> </HTML>