Text alert for enter and exit

Written by @kerixa 21 August 2012

Show a message when enters to website and a message when he/she wants to exit or redirect the page

Code Snippet:

                                                
                                                <!-- this script is provided by www.javascriptfreecode.com coded by: Kerixa Inc. -->
<script language="javascript" type="text/javascript">

alert("Welcome to my weblog")

</script>
<h1>

<!-- hide script from old browsers -->
<!--this is on example of a long JavaScript comment-->

<script language="javascript" type="text/javascript">

document.write("IranJavaScript")

//end hiding script from old browsers -->
</script>
</h1>

</body>
</html>

<!--   DESCRIPTION:  This will cause an elert message before your visitor leaves (OR reloads) your page. 
	INSTRUCTIONS:  Place this tag where your BODY tag is.  Make changes to attributes (TEXT, LINK, VLINK, BGCOLOR, etc.) as necessary.
	FUNCTIONALITY: Works in both Netscape and IE.

//Modified by CoffeeCup Software 
//This code is Copyright (c) 1997 CoffeeCup Software 
//all rights reserved. License is granted to a single user to 
//reuse this code on a personal or business Web Site. 
-->


<BODY onUnload="window.alert(' Good Bye ')">


</BODY>
<!--   DESCRIPTION:  This will cause an alert message before your visitor leaves (OR reloads) your page. 
	INSTRUCTIONS:  Place this tag where your BODY tag is.  Make changes to attributes (TEXT, LINK, VLINK, BGCOLOR, etc.) as necessary.
	FUNCTIONALITY: Works in both Netscape and IE.

//Modified by CoffeeCup Software 
//This code is Copyright (c) 1997 CoffeeCup Software 
//all rights reserved. License is granted to a single user to 
//reuse this code on a personal or business Web Site. 
-->
<a target='_blank' href='www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Bongani Radebe, sumanmukh1999@gmail.com, Jack the gripper♡, mbedel25, irwansrahman
advertisement 2