WP_Scripts: output script element only if src not empty
|Reported by:||niallkennedy||Owned by:||nacin|
|Component:||General||Keywords:||has-patch 3.7-early commit|
I'd like to be able to asynchronously load an enqueued script without needing to completely rework WP_Scripts. I'd like to take advantage of common handles indicating a script is set to be loaded, extra data attached to a handle, and other WordPress script expectations while swapping out the <script src=""> echoed markup.
Why async? A script steps out of the way, offering progressive enhancement of the page or loading non-critical features such as stats or socal network sharing buttons. Async loading also helps prevent single points of failure in webpage loading caused by China blocking Facebook or resources hosted at Amazon Web Services going offline for a few hours.
Change History (7)
3 years ago
- Keywords 3.7-early added
- Milestone changed from Awaiting Review to Future Release
- Severity changed from trivial to normal