[wp-trac] Re: [WordPress Trac] #9346: wp_enqueue_script() doesn't
work mid-page for footer scripts
WordPress Trac
wp-trac at lists.automattic.com
Tue Mar 17 00:31:57 GMT 2009
#9346: wp_enqueue_script() doesn't work mid-page for footer scripts
--------------------------+-------------------------------------------------
Reporter: Viper007Bond | Owner: azaozz
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: JavaScript | Version: 2.8
Severity: normal | Keywords: needs-patch
--------------------------+-------------------------------------------------
Comment(by azaozz):
Yes the script loader requires all scripts to be queued before the page
starts to load so it can do the dependencies properly. It also supports
wp_print_script() in the middle of the page and would print all
dependencies (if not already in the head) and remove any of them if queued
for the footer.
I suppose we can add support for wp_enqueue_script() in the middle of the
page that would queue scripts only for the footer. Would need to force all
dependencies to print in the footer too even if queued for the head by
default.
That may bring some issues with scripts that cannot run from the footer
properly and are printed as dependency. Perhaps would be better to leave
this as an "advanced" option only.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/9346#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list