0

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

Dustin Laine
  • 37,935
  • 10
  • 86
  • 125
BillZ
  • 247
  • 3
  • 4
  • 9
  • Thanks That worked out with one small issue. When the script loaded the movie which was hidden appeared at the bottom of the page. I placed the script in a div and toggled it to be hidden. Works like a charm. – BillZ Mar 25 '10 at 20:46

1 Answers1

0

Try using $.getScript, it asynchronously loads & runs a javascript file. more info @ http://api.jquery.com/jQuery.getScript/ or jQuery append Google Adsense to div has some good info.

Community
  • 1
  • 1
JKirchartz
  • 17,612
  • 7
  • 60
  • 88