How would I use $('#flashObj').append(); to add text to the two areas that say “append_HERE” in the below code?
edit: what if I had it stored in a variable as a string and wanted to change the values that way?
var flashLayout = '<div id="flashObj">'+
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="20">'+
'<param name="movie" value="dbs/js/singlemp3player.swf?file=append_HERE.mp3&autoStart=false&backColor=000000&frontColor=ffffff&songVolume=90" />'+
'<param name="wmode" value="transparent" />'+
'<embed wmode="transparent" width="200" height="20" src="dbs/js/singlemp3player.swf?file=append_HERE.mp3&autoStart=false&backColor=000000&frontColor=ffffff&songVolume=90" type="application/x-shockwave-flash" />'+
'</object></div>'
Javascript (and jQuery) work with DOM nodes (elements as objects) not ‘text’.
You can either get that code as HTML text and do a regular string replace like so:
Or, even better you should avoid playing with HTML as text and instead change the attribute itself:
PS: You will probably want to do a global replace using a regular expression since
"bar bar".replace("bar", "foo")returns'foo bar'.