این کد هم پیام میده وهم مدت زمان رو مشخص میکنه
<html> <!-- TWO STEPS TO INSTALL TIME ON PAGE (UNLOAD): 1. Put the two codes into the HEAD of your HTML document 2. Add the OnLoad event handler to the BODY tag --> <!-- STEP ONE: Copy the two codes into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin pageOpen = new Date() // End --> </SCRIPT> <SCRIPT LANGUAGE="Javascript"> <!-- Original: Max Harris (mclh@rocketmail.com) --> <!-- Web Site: http://members.tripod.com/~mclh/index.html --> <!--Total Java Scripts 99 - Next Step Software--> <!-- Begin function openFor() { pageClose = new Date(); minutes = (pageClose.getMinutes() - pageOpen.getMinutes()); seconds = (pageClose.getSeconds() - pageOpen.getSeconds()); time = (seconds + (minutes * 60)); if (time == 1) { return (time + " sanie") } return (time + " sanie") } // End --> </SCRIPT> </head> <!-- STEP TWO: Add the OnUnload event handler to the BODY tag --> <BODY OnUnload="alert('hamash ' + openFor() + '. چقدر زود داری میری بازم بیا!')" ;> </BODY> </html>