User:MindstormsKid/vector.js: Difference between revisions
Appearance
Content deleted Content added
m add zeros |
m prepend |
||
Line 3: | Line 3: | ||
// clock! |
// clock! |
||
addOnloadHook(function(){ |
addOnloadHook(function(){ |
||
jQuery("#p-personal ul"). |
jQuery("#p-personal ul").prepend('<li id="pt-time">'); |
||
setInterval(function(){ |
setInterval(function(){ |
Revision as of 05:07, 29 August 2009
document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>');
// clock!
addOnloadHook(function(){
jQuery("#p-personal ul").prepend('<li id="pt-time">');
setInterval(function(){
var date = new Date();
jQuery("#pt-time").html(addzero(date.getUTCHours()) + ":" + addzero(date.getUTCMinutes()) + ":" + addzero(date.getUTCSeconds()));
}, 1000);
function addzero(n) { return (n < 10 ? "0" : "") + n; }
});