views:

81

answers:

1

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'/&gt;");
    });
});

-- html --

<div id="movieContainer">
    <script id="movieTag" language='JavaScript' src='http://www.accelacast.com/programs/launch.js'/&gt;
</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

A: 

Try using $.getScript, it asynchronously loads & runs a javascript file. more info @ http://api.jquery.com/jQuery.getScript/ or http://stackoverflow.com/questions/1142861/jquery-append-google-adsense-to-div has some good info.

JKirchartz