Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Define a CDN in a Qlik Sense Extension

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?

1 Solution

Accepted Solutions
Aiham_Azmeh
Employee
Employee

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

View solution in original post

5 Replies
Aiham_Azmeh
Employee
Employee

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

Not applicable
Author

I'll mark the above correct, but please explain a situation where CDN files may have dependencies.

Aiham_Azmeh
Employee
Employee

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

Stefan_Walther
Employee
Employee

Great, didn't know that detail about RequireJS ...

Alexander_Thor
Employee
Employee

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 }));