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"P" element document.getElementById("loadtime").innerHTML = "Page loaded in:" result " seconds"; </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>
Tidak ada komentar:
Posting Komentar