function mytimeout(w,t) {
var self = this;
self.what = function(c){alert(w);};
self.mytimer = function() {setTimeout(function(){self.what(w);},t);};
}
function Initialize() {
//Load Scripts
alert('loading');
var t1 = new mytimeout('bob',3000);
var t2 = new mytimeout('carol',1000);
t1.mytimer();
t2.mytimer();
}
This works nicely on Firefox for Max and IE for Windows. This of course is the generic version. The Initialize gets called in the index.html and this is in a loaded JavaScript file. I hope someone else might find this useful. I think it is pretty easy to understand. To give fair credit I did work off the reading from the website:
http://www.west-wind.com/weblog/posts/5033.aspx
No comments:
Post a Comment