Last active
April 17, 2021 08:03
-
-
Save ruan4261/7ec3005c3cb8e086a50c6f97bbb83bf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.appendChild(document.createTextNode(text)) | |
newEle.type = type || 'text/javascript' | |
container.append(newEle) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment