PAGE-LOAD TIMER SCRIPT FOR BLOGGER BLOGS.

 On Minggu, 15 Juli 2012  

Have you seen websites displaying web-page load time? Do you want this feature in your blog? If yes,then Read-on.

In this post,I will be explaining how you can easily add this widget to your blog.

How to add load timer to blogger blogs

To add this widget to your blog,follow the steps below.

Step 1:

Login to Blogger & go to Design/Layout » Edit HTML[Always remember to backup your template.] Check the box next to Expand Widget Template and search for <head> by pressing CTRL+F. Once you get that,copy-paste the codes below directly after it.
<!-- page load timer --> <script type='text/javascript'> var d = new Date(); var starttime = d.getTime(); //Get the start time </script>

Step 2:

Find </body> in your template and immediately before that,copy-paste this code:
<!-- page load timer begins --> <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 ends -->

Preview and Save template.

Step 3:

Login to Blogger » Design »Page element and select 'Add a gadget'. Next,scroll down till you find "HTML/JAVASCRIPT" and click on ADD. Now,copy-paste the following codes in it:
<!-- Widget portion --> <p id="loadtime">Your custom message goes here</p>
Finally,save widget and view your blog to see the load-timer. If you are not satisfied with the “Page loaded in:” that displays together with the load-time,simply change it in “step 2” above.
PAGE-LOAD TIMER SCRIPT FOR BLOGGER BLOGS. 4.5 5 Unknown Minggu, 15 Juli 2012 Have you seen websites displaying web-page load time? Do you want this feature in your blog? If yes,then Read-on. In this post,I will be exp...


Tidak ada komentar:

Posting Komentar