Look at the library you are attempting to use and focus on the first few lines and their closing syntax:
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, (function () { 'use strict';
//lots of code
})));
https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.jsThis library is coded using the so-called
UMD (
Universal Module Definition) pattern which attempts to unify
(1) Global,
(2) AMD (
Asynchronous Module Definition) and
(3) CommonJS (Common JavaScript) module loaders into one universal format. Unfortunately it uses some very weird JavaScript that even experts would stumble over understanding unless they wrote it themselves. See this article for an explanation of
UMD:
http://davidbcalhoun.com/2014/what-is-amd-commonjs-and-umd/I think if you comment out the following two lines you can use the library as a global script loaded using
$.getScript().
;(function (global, factory) {
//typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
//typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, (function () { 'use strict';
//lots of code })));
This implies you copy the file form the CDN and host it as a code page within QuickBase. I will test this myself later but I don't have the time at the
moment (that's a pun!).