ManyCodes.com – codes & scripts Get free programming codes and tutorials!

28Jul/090

How to have a text alert when entering and exiting your website

Here is how you can have a text alert when entering and exiting your website.

Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website

Code:

<!-- this script is from www.manycodes.com -->
<script language="javascript" type="text/javascript">

alert("Welcome to my weblog")

</script>

<body>
<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>

<!--   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 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>

<font face="Tahoma"><a target="_blank" href="http://www.manycodes.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>



Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Webnews
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Ask
  • Facebook
  • Technorati
  • YahooBuzz