enhance
enhance copied to clipboard
External JavaScript
Had a use case where I wanted the Google Maps API to load asynchronously after page load using enhance. Two problems:
With quickconcat, it just attempted to lump it in with the other files:
ejs.addFile ( 'http://maps.google.com/maps/api/js?sensor=false' );
// led to
http://localhost/_tmpl/_css/http://maps.google.com/maps/api/js?sensor=false,etc
Also, I wanted to run another local file after the maps api had successfully loaded. I know this gets into a weird area with dependency management and overlap with more complex/feature-full resource loaders.
What do you think about an ejs.addExternalFile( resourceUrl, callback )
or perhaps returning a promise instead of callback hell?