jQuery: Loading swf file from server after the button click
I have a web page with swf file defined this way
<object width="600" height="400" type="application/x-shockwave-flash" id="plist" data="/site_media/apps/problemme.swf">
<param id="board" name="flashvars" value="id={{ id }}">
</object>
What I want to do is to reload this object after button click (also I want to change value of flashvar parameter).
What I've done so far is
function clickRetryButton(){
$("#board")开发者_C百科.attr('value', 'id={{ 1 }}');
}
This function changes value of the flashvar after the button is clicked. I wonder how can I refresh the flash object (so it's built from the beginning with a new flashvar)?
You can use cloneNode
to copy the object, remove the old one and append the new one.
var old = document.getElementById("plist");
var new = old.cloneNode(true);
new.children[0].value = "id={{ 1 }}"; //change value of flashvar
//remove the old node from parent
//append the new node to parent
精彩评论