Replacing content with jquery.

Posted by BillZ on Stack Overflow See other posts from Stack Overflow or by BillZ
Published on 2010-03-22T23:43:49Z Indexed on 2010/03/22 23:51 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

I am loading a movie into a overlay. My problem is that when I close the div overlay the movie continues to play. I do not control the code on the move side it is imported via a script tag which then opens in a iframe. I am able to remove the content of the of the div and then the movie stops playing. Then of course when the user opens the div again the movie is gone. My current thinking was that I could simply replace the script tag with one just like it but the outcome of that is that there is nothing there. I have been using jquery.

Thanks

-- script --

$(document).ready(function() {
    $("#closeModal2").click(function() {
        $("#movieContainer").html("<script src='http://www.accelacast.com/programs/launch.js'/>");
    });
});

-- html --

<div id="movieContainer">
    <script id="movieTag" language='JavaScript' src='http://www.accelacast.com/programs/launch.js'/>
</div>

On a side note. I tried replacing the src attribute of the script tag with no luck. I was able to replace the src of a image though. Is it not possible to effect the src attribute of script?

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about dynamic