This is the blog of the twin..Come on! Follow us!

Monday, 28 November 2011

Letak 'Show Your Page Loading Time'

 Korng nk ke bnde alah nie? Ntah la..mne tau kot2 ad orng teringin..
Follow step-step nie eh?

                                      



STEP #1
Log in -> Layout -> Edit HTML pastu korng click tick-box Expand Widget Templates
Then, find (CTRL+F) code nie dalam template korng<head>
Dan selepas code tu..korng paste pulak code nie..

<!-- page load timer -->
<script type='text/javascript'>
var d = new Date();
var starttime = d.getTime(); //Get the start time
</script>


STEP #2

Now find (CTRL+F) code nie dalam template korng mcm tadi korng buat:
</body>
pastu, korng paste pulak code nie sebelum kod kat ats tuu:

<!-- 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 &quot;P&quot; element
document.getElementById(&quot;loadtime&quot;).innerHTML = &quot;Page loaded in: &quot;+ result +&quot; seconds&quot;;
</script>
<!-- page load timer end -->


Now click Save Template



STEP #3 , go to Layout

                 


Add a Gadget of HTML/JavaScript type.

                                         

pastu..korng letak code nie..

<!-- Widget portion -->





<p id="loadtime">Write your custom message here</p>


0 comments:

:a   :b   :c   :d   :e   :f   :g   :h   :i   :j   :k   :l   :m   :n   :o   :p   :q   :r   :s   :t

Post a Comment