...

View Full Version : Using Javascript to play music..



Dieter
05-25-2005, 07:48 PM
Hi is there a way to use javascript to display music.

I know that this is using html but Is it possible to have a drop down menu thing that will play a song like this thing does when you click on the one you want.
<center><embed src="URL of MEDIA" width="200" height="20"></center>
So far I have only seen one that uses "oleobject/application" or whatever and this does not work on macintosh computers.

rlemon
05-25-2005, 08:15 PM
<embed> work tho eh?

so...

link it to the drop down menu and on change run this function

function music(song){
var html = "<embed src='url/of/"+song+".wav' width='200' height='20'>"
document.write(html);
// or you can use innerHTML
// var songArea = document.getElementById('divID');
// songArea.innerHTML = html;
return;
}


ohh and the 'songArea' is

<div id="divID"></div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum