Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
Look at the library you are attempting to use and focus on the first few lines and their closing syntax:
This 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) {https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js
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 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) {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!).
//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 })));
ArchiveUser
8 years agoQrew Captain
I am having similar issue with this library http://kendo.cdn.telerik.com/2017.3.913/js/kendo.all.min.js