I updated the code below after …

I updated the code below after talking to Ivan at WebKreator. It now works without opening a new window!


<body bgcolor="#FFFFFF" fgcolor="#000000" onload="javascript:endTime()">
<img src="" width=1 height=1 name="counter">

<script language="javascript">
<!--
var now = new Date();
var start = now.getTime();

function endTime()
{
    var now = new Date();
    var end = now.getTime();
    timeToComplete = ( end - start ) / 1000;
    alert( "this page took "+timeToComplete+" seconds to load!" );
    document.counter.src="/icons/text.gif?time="+timeToComplete;
}
// -->
</script>

Published by

Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Google+ and Twitter.

Leave a Reply