WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #22244, comment 22


Ignore:
Timestamp:
10/23/12 21:58:38 (2 years ago)
Author:
scribu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22244, comment 22

    v1 v2  
    1 > This would break because jQuery would be forced to the footer, while the other script would print in the header: 
     1 
     2 
     3This is unfortunately a wontfix. Yes, loading scripts in the footer can mean more HTML gets downloaded first, though the difference is negligible and there are better ways to extract speed from a site. 
     4 
     5But: Changing jQuery to load in the footer can instantly break JavaScript that previously worked. This can include JavaScript inserted directly into post content, or scripts loaded in the header or in the middle of the page, or scripts printed in the footer but before jQuery. 
     6 
     7This would break because jQuery would be forced to the footer, while the other script would print in the header: 
    28 
    39{{{ 
     
    612}}} 
    713 
    8 I was thinking more of scripts that didn't use `wp_enqueue_script()` at all, but yeah, I've seen this pattern enough times to agree with you that it wouldn't be a good idea. 
     14It does not matter that dependencies should have been used. It is too late to make a change like this. Common practices sometimes beat out best practices. You can do this on your own site if you'd like, but we will not be making a change in core. Sorry. Most other scripts are registered for the footer, and including all of jQuery UI.