Interesting bits of javascript

Correctly install handler (in a loop)

selObj.onchange = function (i) {
    return function () {
        dynamicOptionListObjects[i].change(this);

    };
}(dol.index);

JavaScript does not have block-scope, but you can fake it (not sure how useful this code is yet):

(function () {
    var x = ...;
})();
page_revision: 1, last_edited: 1224638295|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License