0 Add "Page loaded in ..." For blogger

Add "Page loaded in ..." For blogger


Today with a light added is They show the page load time , as in this picture



This add-on is very easy
As usual we go to control panel, Design and Edit HTML

 - 


First thing take a backup of your template.
click "Expand Widget Templates"
and look for this words
<Head>
 and past this code  under it
<!-- page load timer -->
<script type='text/javascript'>
var d = new Date();
var starttime = d.getTime(); //Get the start time
</script>
now look for this :
</body>
and past just before it this code :
<!-- page load timer start by a4why.blogspot.com -->
<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 &quot;P&quot; element
document.getElementById(&quot;loadtime&quot;).innerHTML = &quot;Page loaded in: &quot;+ result +&quot; seconds&quot;;
</script>
<!-- page load timer end by a4why.blogspot.com-->
 save the template
   

  then go to "pageElements"



and add a gadget "HTML/JavaScrpit"
Put This code and save
<!-- Widget portion -->
<p id="loadtime">a4why.blogspot.com</p>
change "a4why.blogspot.com" with what you want

The result will be show the time of loaded the page In the place that you put the gadget



0 comments:

Enregistrer un commentaire

Most Viewed

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More