javascript - Replacing part of an object's param value with value from an anchor? -
if you've got following:
<object type="application/x-shockwave-flash" height="609" width="1000" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=jonnyflyspeed" bgcolor="#000000"> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="allownetworking" value="all" /> <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /> <param name="flashvars" value="hostname=www.twitch.tv&channel=channelnamehere&auto_play=true&start_volume=75" /> </object>
is there way change value="hostname=www.twitch.tv&channel=channelnamehere&auto_play=true&start_volume=75"
, channelnamehere part of value using normal text link? example:
<a href="#" value="newchannelname">
sorted way of reloading whole object new details:
the link is:
<a onclick="changechannel('channelname')"> <script> function changechannel(intvalue){ document.getelementbyid("test").innerhtml = '<object type="application/x-shockwave-flash" height="609" width="1000" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel='+intvalue+'" bgcolor="#000000"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="allownetworking" value="all" /><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=www.twitch.tv&channel='+intvalue+'&auto_play=true&start_volume=75" /></object>' } </script>
Comments
Post a Comment