Question

With the following code

var $altContent = $elem.children('img').attr('alt');

$('.fp_preview').prepend("<div id='video-flv'>  <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' width='720' height='480' id='flv'> <param name='movie' value='WNFlvPlayer.swf' /> <param name='allowfullscreen' value='true' /> <param name='flashvars' value='file='"+
$altContent+
"&autostart=true' /> <embed src='WNFlvPlayer.swf' flashvars='file='"+$altContent+"&autostart=true' allowfullscreen='true' width='720' height='480' name='flv' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer' /> </object> </div>").fadeIn(2000);

I get:

<param 04.flv&autostart="true'" animations="" arch="" renders="" 
value="file=" name="flashvars">

i think is something about nested quotes.

Was it helpful?

Solution

Try this

var $altContent = $elem.children('img').attr('alt');
alert($altContent);
$('.fp_preview').prepend(
'<div id="video-flv">'+
'  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="720" height="480" id="flv">'+
'    <param name="movie" value="WNFlvPlayer.swf" />'+
'    <param name="allowfullscreen" value="true" />'+
'    <param name="flashvars" value="file='+$altContent+'&autostart=true" />'+
'    <embed src="WNFlvPlayer.swf" flashvars="file='+$altContent+'&autostart=true" allowfullscreen="true" width="720" height="480" name="flv" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />'+
'  </object>'+
'</div>'    
).fadeIn(2000);

OTHER TIPS

it works with >

change value='file='"+ to value='file="+ –

<param name='flashvars' value='file="+$altContent+"&autostart=true' /> 

thannkss!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top