I want to backup if js moment is not loaded from CDN. I could not find a useful resource on the Internet, nor on momentjs.com , to find out if Moment js is present.
Here is my code:
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script> <script> // If moment.js is not loaded, use the fallback if () { document.write('<script src="assets/plugins/moment/moment.min.js"><\/script>'); } </script>
javascript cdn momentjs fallback
Garric15
source share