Entry
How do I change the src in a layer (n4) or iframe (n6, it works in IE) on an unload event so that I can popup a window upon exiting?
Nov 21st, 2002 09:25
Klaus Bolwin, Ed Brandmark,
Assuming the variable url contains the new URL and iframeid is the ID of
the iframe, you can change the src in an iframe (n6 and IE) using the
following code:
getziel().location.href = url;
function getziel()
{
if (!document.all) return
document.getElementById("iframeid").contentWindow;
else return document.all.iframeid.contentWindow;
}
unfortunenatly
document.getElementById("iframeid").contentWindow.location.href = url;
does not work in M$IE, thus we need the cross browser code shown above.