Changes between Version 3 and Version 4 of TracDev/JavaScript
- Timestamp:
- Dec 8, 2008, 4:33:03 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/JavaScript
v3 v4 21 21 There is a good description of closures and `(function(){})()` construct at http://ajaxian.com/archives/secrets-of-the-javascript-ninja-a-sneak-peak-for-ajaxians 22 22 23 ==== $(document).ready() ==== 24 25 To execute and modify DOM tree JavaScript function should usually wait until a page fully loads. With jQuery it looks like: 23 26 {{{ 24 #!comment 25 add comments from the http://groups.google.com/group/trac-dev/browse_thread/thread/bd2ad5f23b6a988?hl=en 27 $(document).ready(function_name); 26 28 }}} 29 In non-conflicting mode, code that executed in Trac on page startup is enveloped in closure and looks like: 30 {{{ 31 jQuery(document).ready(function($) { ... }); 32 }}}