Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to reference a CDN (reference js or css via url) in the define statement of a Qlik Sense Extension? I may have missed it, but I don't think I've seen a reference to a CDN.
If so, please provide an example for me to see how to do it.
From a best practice standpoint, what is your opinion of using a CDN in an extension?
Hi Jeffrey,
Using a CDN is fine in an extension (see attached HCbasicLine.zip) a highchart.js extension example.
The tricky part is injecting CDN's that are dependent to each other, it's something that have to be tested.
aiham
Hi Jeffrey,
Using a CDN is fine in an extension (see attached HCbasicLine.zip) a highchart.js extension example.
The tricky part is injecting CDN's that are dependent to each other, it's something that have to be tested.
aiham
I'll mark the above correct, but please explain a situation where CDN files may have dependencies.
Let's say you have the main library of highchart.js and you need to get in also the Highchart 3D plugin like in this example: Edit fiddle - JSFiddle
You may go into trouble with the plugin loading faster than the library itself.
aiham
Great, didn't know that detail about RequireJS ...
Personal preference but I usually define it in the require config instead.
Benefit is that I can then shim modules if I need a specific load order.
require.config({
paths: {
'somelibrary': 'https://somecdn.com/somelibrary'
}
})
define(['somelibrary'], function() { //extension code }));