I have an web application which repeatedly downloads wav files
dynamically (after a timeout or as instructed by the user) into an
iframe in order to trigger the a default audio player to play them.
The application targets only FF 2 or 3. In order to determine when the
file is downloaded completely, I am hoping to use the window.onload
handler for the iframe. Based on this stackoverflow.com answer I am
creating a new iframe each time. As long as firebug is enabled on the
browser using the application, everything works great. Without
firebug, the onload never fires. The version of firebug is 1.3.1,
while I've tested Firefox 2.0.0.19 and 3.0.7. Any ideas how I can get
the onload from the iframe to reliably trigger when the wav file has
downloaded? Or is there another way to signal the completion of the
download? Here's the pertinent code:

HTML (the CSS class hidden's only attribute is display:none;):

<div id="audioContainer" class="hidden">
</div>

JavaScript (loading is a div declared in the HTML):

waitingForFile = true; // (declared at the beginning of closure)
$("#loading").removeClass("hidden");
var content = "<iframe id='audioPlayer' name='audioPlayer' src='" +
    /path/to/file.wav + "' onload='notifyLoaded()'></
iframe>";
document.getElementById("audioContainer").innerHTML = content;

And the content of notifyLoaded:

function notifyLoaded() {
    waitingForFile = false; // (declared at beginning of the closure)
    $("#loading").addClass("hidden");
 }

I have also tried creating the iframe via document.createElement, but
I found the same behavior. The onload triggered each time with firebug
enabled and never without it.

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en.

Reply via email to