Created
February 22, 2019 17:36
-
-
Save andreibabor/be4b53d8bec532fb8485f1cebd7b6997 to your computer and use it in GitHub Desktop.
Javascript create text/javascript using var
This file contains hidden or 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
<script> | |
$( document ).ready(function() { | |
//create a script element and set it's type and async attributes | |
var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; | |
//set the source of the script element | |
script.src = 'https://widgets.quadpay.com/stfrank/quadpay-widget-0.2.0.js?type=calculator&min=1&max=2500'; | |
//add the script element to the DOM | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s); | |
//~initialise what you want~ | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment