Finally I got around to re-codeĀ http://tv.autopsy.se again. Enjoy!
javascript and timers sucks!
Have been trying to get my head around timers in javascript. And I guess i know how it works now. My approach:
<script>
var timer;
function whatever() {
if ( timer )
clearTimeout(timer);
alert("you just wasted 15 seconds of your life..");
timer = startTimeout('whatever()', 15000);
}
</script>
and in the html:
<body onLoad="timer = startTimeout('whatever()', 15000);"> yada yada..
this will generate an annoying popup (if I made the example correct..) every 15 seconds..
Why I need this? Well, on tv.autopsy.se I want to update the search cloud continuously without having to do some reloads. And I also have a timer that waits 4s to insert data into the database for the search cloud. Neat, huh?
Tags
Apple Arlanda Audiobooks Canada Code Poetry England faac Firefox first post Heatrow iPhone iPod iTunes Javascript job Links Linux London Mac mdadm Montreal mpg321 MySQL Named Capture Netbook On the plane pacemaker PC Perl PHP Picture RAID Reading RegExp Server Stockholm Sucks! (Really!) Sundsvall Sweden Tips Travel Traveling tv.autopsy.se Unix WordpressDemoscene
projects
Categories
Twitter
Error: Twitter did not respond. Please wait a few minutes and refresh this page.