Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
reading props of a setTimeout
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jonas Raoni, post: 4909776"] Lee escreveu: Awww, don't act like Mr. Spock, I'm just trying to help the other guy, I'm not here to discuss superfluous things nor "fight"... =/ But you're really missed something, not just the "o" is a global var... The Timer is one too... But you know everything can be hidden, it's quite easy... But in my opinion it isn't worth to write such things: (function(){ var o = new Timer; document.onclick = function(){ o.running ? (o.stop(), alert("Stopped at " + o.n)) : (o.run(), alert("Started at " + o.n)); }; })(); (document.onclick = function(){ var o = arguments.callee.o; o.running ? (o.stop(), alert("Stopped at " + o.n)) : (o.run(), alert("Started at " + o.n)); }).o = new Timer; : There are a bunch of ways to achieve this... I'll check if I can answer another email, then I'll be away, time for the party... I hope Mr. Spock to not reply my messages :D [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
reading props of a setTimeout
Top