Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

latest Version of Firefox not executing the functions/code in the window.onbeforeunload and window.onunload .

  • 3 trả lời
  • 4 gặp vấn đề này
  • 7 lượt xem
  • Trả lời mới nhất được viết bởi BalajiPolisetty7

more options

can you please provide the proper solution how to execute the code in window.onbeforeunload or window.onunload on refreshing the browser , closing the tab , closing the browser itself.

I am facing the problem with the latest version of firefox only . it is very critcial to one of our projects.

can you please provide the proper solution how to execute the code in window.onbeforeunload or window.onunload on refreshing the browser , closing the tab , closing the browser itself. I am facing the problem with the latest version of firefox only . it is very critcial to one of our projects.

Tất cả các câu trả lời (3)

more options

Code should still be executed, including one "Are you sure you want to leave this page?" prompt. It's just additional alert/confirm/prompts that are ignored.


<script>window.onbeforeunload=function (e) { e.returnValue = '?'; }</script>
<body onunload="alert('onunload');" onpagehide="alert('onpagehide');">
close me
</body>

more options

Based on the confirmation message i want to execute some piece code. Could you please help me how to proceed if we select leave page/ stay on this page.

Thanks alot ...

more options

now on close the firefox browser window.onunload is not calling. can you please help me