Dynamically Created Iframe Used To Download File Triggers Onload With Firebug But Not Without
EDIT: as this problem is now 'solved' to the point of working, I am looking to have the information on why. For the fix, see my comment below. I have an web application which repe
Solution 1:
Old question but for future reference: As far as my experience onLoad is not called for file downloads. A way to solve it is to use cookies like they do here http://gruffcode.com/2010/10/28/detecting-the-file-download-dialog-in-the-browser/
Solution 2:
Here's an example that works for me, without Firebug open (tested in FF 3.6.2 Mac): http://www.jsfiddle.net/Kukry/
I'm using the jQuery .load()
event instead of onload
.
var iframe = $("<iframe/>").load(function () {
alert("loaded");
}).attr({
src: "http://code.jquery.com/jquery-1.4.2.min.js"
}).appendTo($("#thediv"));
Note that I'm loading a JavaScript file, not an audio file, so that might make a difference.
Solution 3:
Maybe you call some Firebug internal function, like console.log(), somewhere? In that case, Firefox will threw an exception which can stop the execution if Firebug is not active.
Post a Comment for "Dynamically Created Iframe Used To Download File Triggers Onload With Firebug But Not Without"