I think this script is to pass arguments to setTimeout executed
function, may it be?
reggards
Marc
En/na mcot ha escrit:
I see this code in the prototype lib and just wondering whats going on
(see my comments for specific questions):
Object.extend(Function.prototype, (function() {
...
...
...
function delay(timeout) {
var __method = this, args = slice.call(arguments, 1);
timeout = timeout * 1000
return window.setTimeout(function() {
return __method.apply(__method, args); // where does this get
"returned to"?
/*
According to mozilla docs (https://developer.mozilla.org/en/DOM/
window.setTimeout) setTimeout should just return a unique id to use
with clearTimeout() and all of my tests show this to be true.
*/
}, timeout);
}
...
...
...
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]