A
ajaykumarsinghal
Hi,
I am working on an iframe based application and need to warn user when
they navigate to anyother site or close the browser. To do this i
tried following:
<script language='javascript'>
window.onbeforeunload = unloadMessage;
function unloadMessage() {
window.focus();
window.event.returnValue = "If you continue
all applications will be closed automatically!"
}
</script>
It works when user types anyother site in the address bar and try to
close the browser. But when user navigates within site and we show
different content in iframe this event fires in those cases as well.
Is there any way to ignore this event for content change within iframe
and keep on working for entire browser window?
Thanks,
I am working on an iframe based application and need to warn user when
they navigate to anyother site or close the browser. To do this i
tried following:
<script language='javascript'>
window.onbeforeunload = unloadMessage;
function unloadMessage() {
window.focus();
window.event.returnValue = "If you continue
all applications will be closed automatically!"
}
</script>
It works when user types anyother site in the address bar and try to
close the browser. But when user navigates within site and we show
different content in iframe this event fires in those cases as well.
Is there any way to ignore this event for content change within iframe
and keep on working for entire browser window?
Thanks,