伙计们,我厌倦了试图在 IE 中运行时清空 div 的内容!
我只需要清空 div 的内容,因为每次我都需要显示一个新视频,比如 youtube。
我尝试了所有类似的方法$('#divvideo').empty("")
,$('#divvideo').remove()
但在 IE 中对我没有任何作用。你能建议我该怎么做吗?
$('#divvideo').html("");
this.$Embed = $('<embed></embed>');
this.$Embed.attr({ src: src.href });
this.$Embed.attr({ width: "420" });
this.$Embed.attr({ height: "366" });
this.$Embed.attr({ type: "video/x-ms-wmv-plugin" });
this.$Embed.attr({ pluginurl: "http://www.microsoft.com/windows/windowsmedia" });
this.$Embed.attr({ allowchangedisplaysize: "1" });
this.$Embed.attr({ autosize: "1" });
this.$Embed.attr({ displaysize: "1" });
this.$Embed.attr({ showcontrols: "1" });
this.$Embed.attr({ showstatusbar: "1" });
this.$Embed.attr({ autorewind: "1" });
this.$Embed.attr({ autostart: "1" });
$('#divvideo').append(this.$Embed);