Finally I got around to re-code http://tv.autopsy.se again. Enjoy!
02
Oct
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: Javascript, tv.autopsy.se
posted by ube in Javascript and have No Comments
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
- Foto: Stjärnfotograf http://photos.autopsy.se/stjarnfotograf/ 2 days ago
- Väger 10 kilo mindre än för 18 år sen, och 37 kilo mindre än för 8 år sen. Lite stolt kan man väl vara? 2 days ago
- Foto: Gadgets! http://photos.autopsy.se/gadgets/ 2 days ago
- no rar support in @plexapp / nine #fail ! 3 days ago
- @jonasgulle tycker du inte om Java? 4 days ago
© blog.autopsy.se 2009 | Created by Jay Hafling.
Powered by WordPress