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 Coder
    Join Date
    Apr 2005
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing object and embed

    Ok, i've got a site were a lot off radio stations are put together. Now I wan't to simply change the player to play a other station with a klik.

    The code looks this way:
    Code:
    <object id="mediaplayer" width=351 height=64 classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" standby="" type="application/x-oleobject">
    	<param name="url" value="http://www.slamfm.nl/stream/slamfm.asx">
    	<param name="invokeurls" value="false">
    	<param name="autostart" value="true">
    	<param name="uimode" value="mini">
    	<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/" src="http://www.slamfm.nl/stream/slamfm.asx" name="mediaplayer" width=351 height=64 showstatusbar=1 autostart=1 invokeurls=0></embed>
    </object>
    So I was thinking to put a wrapper around the thing I wanna change and change the innerHTML, this is what i've got:
    Code:
    <html>
    <head>
    <title>Songtastic Jukemeister</title>
    <script>
    function changeStation(station){
    
      var element = document.getElementById('station_wrapper_value');
      element.innerHTML = '<param name="url"  value="' + station + '">';
    
      var element = document.getElementById('station_wrapper_src');
      element.innerHTML = '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/" src="' + station + '" name="mediaplayer" width=351 height=64 showstatusbar=1 autostart=1 invokeurls=0></embed>';
    
    }
    
    }
    </script>
    <body>
    <object id="mediaplayer" width=351 height=64 classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" standby="" type="application/x-oleobject">
    	<div id="station_wrapper_value">	
    	<param name="url" value="http://www.slamfm.nl/stream/slamfm.asx">
    	</div>
    	<param name="invokeurls" value="false">
    	<param name="autostart" value="true">
    	<param name="uimode" value="mini">
    	<div id="station_wrapper_src">
    	<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/mediaplayer/" src="http://www.slamfm.nl/stream/slamfm.asx" name="mediaplayer" width=351 height=64 showstatusbar=1 autostart=1 invokeurls=0></embed>
    	</div>
    </object>
    
    <a href="javascript:changeStation('http://www.garnierstreamingmedia.com/asx/veronicaradio.asp');">Radio 538</a>
    </body>
    </html>
    But for some reason it doesn't work, does somebody has an idea what I did wrong?

    Thanks in advance,
    Last edited by WA; 01-07-2010 at 03:50 AM.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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