SQL PHP HTML ASP JavaScript articles and free scripts to download
 

onunload event trigger

When we exit a page or close the browser tab we can trigger an event by using onunload . However when we close the browser then it can't be displayed. To check this code open the demo page in one new tab and then try to close the tab or visit to a different URL to exit the page. The source code of the demo page is here.

Here is the demo of onunload event

The source code of the demo page is here.

<!doctype html public "-//w3c//dtd html 3.2//en">

<html>
<head>
<title>Demo of onunload event trigger</title>
</head>
<body onunload="alert('thanks for visiting plus2net')";>
You should get one alert message when you close this page or exit this page.

</body>
</html>




Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Event Handling