Created
July 18, 2012 18:43
-
-
Save ndv/3137982 to your computer and use it in GitHub Desktop.
Loading JS API dynamically
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.ControlPanelJSLoaded = function() { EcwidCheckout.init({/* something */}); }; | |
var script = document.createElement('SCRIPT'); | |
script.src = "https://checkout.ecwid.com/controlpanel-api.js"; | |
script.charset = "utf-8"; | |
script.setAttribute("type", "text/javascript"); | |
script.onerror = function() { alert('Could not load script'); }; | |
document.body.appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment