object, param, jquery

前端 未结 5 1180
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 15:33

    
    
             


        
      
      
      
5条回答
  •  情歌与酒
    2020-12-01 16:11

    EDIT

    The behavior I described below only takes place in IE in particular situations. When the object element was present in the loaded DOM, I could update the value for the param element named movie, but the state of the object didn't change. And the object can't be easily refreshed as far as I know. It looks like the best way is to remove the object element and add a fresh one. For that, it seems like the SWFObject jQuery plugin that SolutionYogi suggests, or something similar, might indeed be the best way to go.

    ORIGINAL

    From what I see when I try this out in IE8, IE retains only the embed elements as the page is loaded, not the object and param elements. So you can't change that value of the param because it no longer exists.

    So if this gets served:

    
        
        
        
        
    
    

    It becomes only this in the IE DOM:

    
    

    To get a movie to update in IE, I had to cause IE to reparse the HTML for embed. The following seemed to work:

    var placeHolder = $("
    "); var tempParent = $("
    "); var embed = $("#movieparent embed"); embed.replaceWith(placeHolder); tempParent.append(embed); embed.attr("src", newSrcUrl); placeHolder.replaceWith(tempParent.html());

提交回复
热议问题