Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Javascript to play music..

    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.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Posts
    1,051
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <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>
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •