...

View Full Version : NS audio



zoobie
07-03-2003, 02:13 AM
This works fine for IE...but is there a simple way to include it for NS6+? I tried putting <embed> in there...didn't work...Thanks

<script>
function play(s){
document.all.tags('bgsound')[0].src=s
}
</script>
</head>
<body>
<bgsound src="">
<input type="button" value="CHIPS" onClick="play('chips.wav');">
<input type="button" value="HELP" onClick="play('help.wav');">

Skyzyx
07-03-2003, 02:29 AM
Well, nothing but IE understands document.all. That's your first problem. Now, assuming all of the HTML is correct, this script should work (in theory... don't have time to test):



<script language="javascript" type="text/javascript">
<!--
function play(s)
{
document.getElementsByTagName('bgsound')[0].src=s;
}
//-->
</script>


This *should* work in every DOM-capable browser. Of course, I'm not sure if bgsound is a valid tag...

zoobie
07-03-2003, 04:22 AM
Nah...Most scripts want the poor NS schmoe to download a plug-in...and by the time he goes thru 4 offsite pages, he's completely lost and can't get back to my site.

I'm thinking an array with a doc.write...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum