I usually use immediate functions to control the scope of variables so as not to pollute the global namespace. This is a very useful model.
(function (window, $, undefined) {
}(this, jQuery));
- window = ‘Bob’ $ jQuery, Prototype, . : "Id undefined - ", , , ; script DoubleClick, , .
JavaScripts . , .