Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What in the world is wrong with this script?

Status
Not open for further replies.

afral

Technical User
Aug 27, 2002
56
US
I need to find out what the devil is wrong with this script. This script is telling Internet Explorer (IE) to download the mp3 instead of play it in the background!
afral@juno.com

--------------------------------------------------
<script language=&quot;JavaScript&quot;

soundclip = &quot;sounds/dancewolf-22-24m.mp3&quot;;

if (navigator.appName == &quot;Netscape&quot;) {
if( navigator.mimeTypes[&quot;audio/mp3&quot;].enabledPlugin != null ){
tag = '<embed src = &quot;' + soundclip + '&quot; autostart=True hidden=True loop=1 type=audio/mp3 >';
document.write(tag);
}
}
else{
tag = '<bgsound src = &quot;' + soundclip + '&quot;>';
document.write(tag);
}
// --></script> Let freedom ring!
 
I am not absolutely positive but i think you need to change the quotes around (soundclip)
from : &quot;' + soundclip + '&quot;
to: ' + soundclip + '
then:....
the resulting variable (tag) would then look like this :

'<embed src='sounds/dancewolf-22-24m.mp3' autostart=True hidden=True loop=1 type=audio/mp3 >';


do this to both occurences of soundclip in the script

regards jim
 
Thanks justjim I will try this. I really appreciate someone who knows more than I. . . Let freedom ring!
 
justjim,
What is happening is this: Download Accelerator by Speedbit prompts me to download Regular or Accelerated. I cancel the order THEN the sound cashes and plays. Hummm. I remember coding the background sounds in a 10 web page presentation. The only problem? when page 2, 3, 4, 5 loaded the sound stopped so the presentation only had music on the first page. I went to Flash and solved the problem only the size of the 3:33 presentation loads in 270 seconds! That's not what I'm trying to do here. I disected 45 and 50 second clips through Goldwave and want these clips to be background sounds. Hummm! I'm going to look at my archives to see what I did in the past. Thanks anyway. . . Let freedom ring!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top