[wp-trac] [WordPress Trac] #25946: Twenty Fourteen: General code cleanup

WordPress Trac noreply at wordpress.org
Sat Nov 23 16:44:57 UTC 2013


#25946: Twenty Fourteen: General code cleanup
---------------------------+--------------------
 Reporter:  obenland       |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  3.8
Component:  Bundled Theme  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+--------------------

Comment (by TobiasBg):

 From what I can see, the standardized jQuery function wrapper in [26332]
 is possibly a change in behavior.

 The new form is a self-invoking closure function with the advantage of
 being able to use `$` in the function again.
 The old form however is/was a short form of jQuery's
 [http://api.jquery.com/ready/ ready()] method (as in
 `jQuery(document).ready(...)`) which is used to be sure that the contained
 code is run once the DOM is ready.

 Now, I'm not an expert in jQuery or JS, but I wanted to bring it up so
 that the JS experts can maybe weigh in. There's some jQuery code in those
 calls that queries some DOM elements, so I could imagine that waiting for
 the `ready` event is a good idea.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25946#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list