PDA

View Full Version : مدت زمان بارگذاری صفحه



Ehsan.PHP
دوشنبه 03 مرداد 1390, 20:01 عصر
سلام. چه جور میشه زمان بارگذاری صفحه رو به ثانیه فهمید؟

mr.zenith
سه شنبه 04 مرداد 1390, 01:15 صبح
سلام
ساده ترین راهش اینه که اول صفحه یک تایمر بگذاری که استارت بشه بعد آخر صفحه بگی متوقف بشه

danijoon
شنبه 08 مرداد 1390, 21:29 عصر
<!--Start of How Long JavaScript -->
<!-- DESCRIPTION: This will pop up a message and tell the user
how long they have been on your site.
INSTRUCTIONS: Place the top part of the script above the HEAD tag.
Place the bottom part with the link in the body of your webpage. Make sure
you include the onLoad function in your BODY tag.
DO NOT PLACE TWO BODY TAGS ON YOUR PAGE.
FUNCTIONALITY: Works in both Netscape & IE.
-->
<SCRIPT LANGUAGE="JAVASCRIPT">
//Modified by CoffeeCup Software
//This code is Copyright (c) 1998 CoffeeCup Software
//All rights reserved. License is granted to a single user to
//reuse this code on a personal or business Web Site.
function time_arrived() {
enter=new Date();
}
function time_here() {
exit=new Date();
time=(exit.getTime()-enter.getTime())/1000;
time=Math.round(time);
alert ("You have been here for " + time + " seconds. Getting tired?")
}
</SCRIPT>
<!-- This should be above the HEAD tag -->

<BODY onLoad='time_arrived()'>
<CENTER>
<FORM>
<INPUT type="button" name="timehere" value="You have been here for..." onClick='time_here()'>
</FORM>
</CENTER>
<!--End of How Long JavaScript -->