Created
December 1, 2020 02:15
-
-
Save ernestofreyreg/c248a9c180ce7277d5e4b12de2f6e5cb to your computer and use it in GitHub Desktop.
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
;(function () { | |
var w = window | |
var mc = w.mortgage_calculator | |
if (typeof mc === 'object') { | |
mc.renderMortgageCalculator(document.getElementById('root')) | |
} else { | |
var d = document | |
var l = function () { | |
var s = d.createElement('script') | |
s.type = 'text/javascript' | |
s.async = true | |
s.src = 'mortgage-calculator.js' | |
var x = d.getElementsByTagName('script')[0] | |
x.parentNode.insertBefore(s, x) | |
s.onload = () => { | |
w.mortgage_calculator.renderMortgageCalculator(document.getElementById('root')) | |
} | |
} | |
if (document.readyState === 'complete') { | |
l() | |
} else if (w.attachEvent) { | |
w.attachEvent('onload', l) | |
} else { | |
w.addEventListener('load', l, false) | |
} | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment