[wp-trac] [WordPress Trac] #9620: problems with the new footer script loader

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 22 10:45:56 GMT 2009


#9620: problems with the new footer script loader
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  azaozz
     Type:  defect (bug)       |      Status:  new   
 Priority:  normal             |   Milestone:  2.8   
Component:  JavaScript         |     Version:  2.8   
 Severity:  major              |    Keywords:        
-------------------------------+--------------------------------------------
 I ran into this while trying to figure out why one of my admin js wasn't
 working on the widgets screen. I was running the following:

 {{{
 wp_enqueue_script('jquery-livequery', $plugin_path .
 'jquery.livequery.js', array('jquery'),  '1.1');
 wp_enqueue_script('jquery-ui-droppable', $plugin_path . 'ui.droppable.js',
 array('jquery-ui-draggable'), '1.7.1');
 wp_enqueue_script('nav-menus', $plugin_path . 'admin.js', array('jquery-
 ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-
 livequery'),  '20090422');
 }}}

 I eventually tossed everything into the footer and things worked fine:

 {{{
 wp_enqueue_script('jquery-livequery', $plugin_path .
 'jquery.livequery.js', array('jquery'),  '1.1', true );
 wp_enqueue_script('jquery-ui-droppable', $plugin_path . 'ui.droppable.js',
 array('jquery-ui-draggable'), '1.7.1', true);
 wp_enqueue_script('nav-menus', $plugin_path . 'admin.js', array('jquery-
 ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-
 livequery'),  '20090422', true);
 }}}

 ... but I still believe it's a genuine bug.

 My script depends on draggable and sortable, both of which land in the
 footer according to WP. Mine would seek to initialize before the footer
 scripts, and would miserably fail as a result.

 To maintain backwards compatibility, footer scripts that are depends of
 scripts that are required in the header should be treated as header
 scripts.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9620>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list