Script injection with Deferred/Promises (non-jQuery)