Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
window.dynamic_import_javascript = function(url, text, type, frameWindow){
frameWindow = frameWindow || window
var doc = frameWindow.document
var container = frameWindow.document.head || frameWindow.document.body
var newEle = doc.createElement('script')
if (url)
newEle.src = url
if (text)
newEle.type = type || 'text/javascript'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment