'__flash__removeCallback' is undefined when deleting DOM element with Youtube iframe

Viewed 4665

I have a div with a Youtube video embedded via iframe.

<div id="container">
    <div id="video">
        <iframe width="480" height="360" src="http://www.youtube.com/embed/LiyQ8bvLzIE" frameborder="0" allowfullscreen></iframe>
    </div>
</div>

I change the content of #container with an ajax call

$.get(url, function(data) {
    ('#container').html(data);
}

Now I get the following error in IE9: "SCRIPT5009: '_flash_removeCallback' is undefined".

I tried removing, deleting,... the video and/or iframe before the ajax call but that doesn't work:

<script>
    $('#video').html('')
</script>

<script>
    $('#video').empty()
</script>

<script>
    $('#video').remove()
</script>

<script>
    $('#video iframe').attr('src', '')
    $('#video').empty()
</script>

<script>
    $('#video').hide()
    $('#video iframe').attr('src', '')
    $('#video').empty()
</script>

...

But now I'm out of idea's...

4 Answers
Related