[wp-trac] [WordPress Trac] #25277: WP_scripts does not allow to add data after the enque has been added to HTML

WordPress Trac noreply at wordpress.org
Wed Jan 7 19:38:30 UTC 2015


#25277: WP_scripts does not allow to add data after the enque has been added to
HTML
-----------------------------------+-----------------------------
 Reporter:  hakre                  |       Owner:  wonderboymusic
     Type:  feature request        |      Status:  reopened
 Priority:  normal                 |   Milestone:  4.2
Component:  Script Loader          |     Version:  3.6
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------------

Comment (by azaozz):

 Also, looking at the "Example Output (after patch)" from the ticket
 description:
 {{{
 <script type='text/javascript'
 src='http://example.com/.../jquery.webticker.js'></script>
 <script type='text/javascript'>
 /* <![CDATA[ */
 jQuery('#webticker').webTicker();
 /* ]]> */
 </script>
 }}}

 The "after" script is best run on `jQuery( document ).ready()` or last in
 the footer, so `jQuery('#webticker')` can be selected properly. Using an
 action like `admin_print_footer_scripts` or `wp_print_footer_scripts` to
 output it would be better/more appropriate.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25277#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list