NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Webmaster Tutorials
Reload this Page A Script that tells you how long u spent on page when closed!

Webmaster Tutorials Instructional webmaster-related how-to's and tutorials.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-23-2006, 05:26 PM THREAD STARTER               #1 (permalink)
NamePros Eliteā„¢
Join Date: Feb 2006
Location: Washington
Posts: 849
Sakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to all
 



Caution A Script that tells you how long u spent on page when closed!


Time Spent on Page


This script displays an alert message when a page is closed, telling the visitor how long (in seconds) they have been on the page. It can also display the time on the page in the title bar.
Code:
<!-- Paste this code into an external JavaScript file named: timePage.js  -->
/*
var time=1;

function timeHere() {
  time = time + 1;
  finalTime = time / 10;
/* Remove the "//" below to display in the title bar
  the amount of time the visitor has been on the site.
  Be aware though, that it does tend to be a bit distracting. */
// document.title = finalTime+" seconds you been here for!";
}

function sayTime() {
  finalTime = time / 10;
  alert("Thank you for coming to my site! \n You have been here " + finalTime + " seconds!");
}



<!-- Paste this code into the HEAD section of your HTML document.
     You may need to change the path of the file.  -->

<script type="text/javascript" src="timePage.js"></script>



<!-- Paste this code into the BODY tag -->

<body onload='window.setInterval("timeHere()", 100)' onunload="sayTime()">
In the code, you may neeed to read some of it. Hope you like the script provided!
????: NamePros.com http://www.namepros.com/webmaster-tutorials/179916-script-tells-you-how-long-u.html

I will continue to paste more scripts soon!
Sakura is offline  
Old 03-23-2006, 10:10 PM   #2 (permalink)
Senior Member
 
bbalegere's Avatar
Join Date: Jul 2005
Location: Bangalore
Posts: 1,271
bbalegere is just really nicebbalegere is just really nicebbalegere is just really nicebbalegere is just really nicebbalegere is just really nice
 



Nice script.
Do you have a php version?
Cause many of my friends disable javascritp as they are paranoid about security.
bbalegere is offline  
Old 03-24-2006, 05:50 PM THREAD STARTER               #3 (permalink)
NamePros Eliteā„¢
Join Date: Feb 2006
Location: Washington
Posts: 849
Sakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to allSakura is a name known to all
 



sorry i dont', but becuase javascripts are the only one i know that creates pop-up. More scripts coming soon thanks to bbalegere.
Sakura is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:31 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger