I'm trying to create a local fallback for loading the mithril.js
file in case the CDN fails.
I want to use the aquivalent of this jQuery
fallback:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/jquery-2.1.1.min.js"></script>')</script>
How do I check if mithril.js
is already loaded?
(I know of the limits of using this fallback and that it takes a long time to load. Using other dependency checker - frameworks is currently not an option)