I need to capture an event which should be triggered just before the content of the iframe disappears.
I have been trying to accomplish something like this
$iframe = $('iframe');
$iframe.beforeunload(function () {
debugger;
});
OR
$iframe = $('iframe');
$iframe.unload(function () {
debugger;
});
I have even tried binding it to the iframe window itself without any luck
$iframe = $('iframe');
$iframe[0].contentWindow.onunload = function () {
debugger;
};
None of these eventhandlers actually trigger for me
and I am quite confused why. To reload the iframe I use .reload()
from outside the iframe and from within, maybe I need to use a different method?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…