Tuesday, March 15, 2011

Javascript Code: Text alert for enter and exit

Show a message when enters to website and a message when he/she wants to exit or redirect the page
 
<!-- this script got from www.javascriptfreecode.com-Coded by: Krishna Eydat -->
<html>
<head>
<script language="javascript" type="text/javascript">

alert("Welcome to my weblog")

</script>

</head>

<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>
</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 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.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
 

No comments:

Post a Comment