Login To Blogger Go To > Design > Edit HTML.
and mark the tick box "Expand Widget Templates"
Then, find (CTRL+F) this code in the template.
<head>
And immediately after it, paste this code:<!-- page load timer -->
<script type='text/javascript'>
var d = new Date();
var starttime = d.getTime(); //Get the start time
</script>
Then, find (CTRL+F) this code in the template:<script type='text/javascript'>
var d = new Date();
var starttime = d.getTime(); //Get the start time
</script>
</body>
And immediately before it, paste this code:<!-- page load timer start -->
<script type='text/javascript'>
var d2 = new Date();
var endtime = d2.getTime(); //Get the end time
//Find the difference between the start and end times
var totaltime = (endtime - starttime)/1000;
//Round 2 decimal places
var result = Math.round(totaltime*100)/100;
//Output results to a "P" element
document.getElementById("loadtime").innerHTML = "Page loaded in: "+ result +" seconds";
</script>
<!-- page load timer end -->
Now click Save the Template.<script type='text/javascript'>
var d2 = new Date();
var endtime = d2.getTime(); //Get the end time
//Find the difference between the start and end times
var totaltime = (endtime - starttime)/1000;
//Round 2 decimal places
var result = Math.round(totaltime*100)/100;
//Output results to a "P" element
document.getElementById("loadtime").innerHTML = "Page loaded in: "+ result +" seconds";
</script>
<!-- page load timer end -->
Then, Go To > Design > Page Elements.
Simply add a Gadget of HTML/JavaScript type.
add this code in to it:
<!-- Widget portion -->
<p id="loadtime">Write your custom message here</p>
Now click save and you are done.
<p id="loadtime">Write your custom message here</p>
0 comments so far:
Post a Comment