<script>
window.onbeforeunload = function()
{
return "This is beforeunload from an iframe.";
}
</script>
This is an iframe with a beforeunload handler.