WordPress.org

Make WordPress Core

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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22244, comment 22

    initial v1  
    1 This 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. 
     1> This would break because jQuery would be forced to the footer, while the other script would print in the header: 
    22 
    3 But: 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. 
    4  
    5 This would break because jQuery would be forced to the footer, while the other script would print in the header: 
    63{{{ 
    74wp_enqueue_script( 'jquery' ); 
     
    96}}} 
    107 
    11 It 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. 
     8I 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.