Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Not applicable

Qlik Sense Server Mashup - Referencing external javascript library

Hi all,

New to javascript so maybe asking a silly question here.

I am trying to use an external text editor tinyMce (TinyMCE - Home) within my mashup but am having some difficulties in connecting to the js file.

In my html file, I have referenced the file using the below code:

<script src="//tinymce.cachefly.net/4.2/tinymce.min.js"></script>

From here, I am not sure how to reference the external file in my javascript file.  I have the following code but it is throwing up a connection error:

function outputText(){

    require(["//tinymce.cachefly.net/4.2/tinymce.min.js"]);

   

     tinyMCE.init({

        mode: "textareas",

        theme: "simple"

    });};

error.PNG

Would appreciate any assistance on this particular issue but also in general on how to use external libraries in conjunction with mashups!

Cheers,

Joel

1 Solution

Accepted Solutions
Employee
Employee

Re: Qlik Sense Server Mashup - Referencing external javascript library

Some comments:

- RequireJS requires a callback, see How to get started with RequireJS

- remove the .js at the end, this will be added by RequireJS by default

So something like that:

function outputText(){

    require(["//tinymce.cachefly.net/4.2/tinymce.min"], function() {

        tinyMCE.init({

        mode: "textareas",

        theme: "simple"

        });

     

  });

};

Not tested ... but that's the direction I think.

Please mark the appropriate replies as correct or helpful so our team and other members know that your question has been answered to your satisfaction.

Hope this helps!

Regards

Stefan

2 Replies
Employee
Employee

Re: Qlik Sense Server Mashup - Referencing external javascript library

Some comments:

- RequireJS requires a callback, see How to get started with RequireJS

- remove the .js at the end, this will be added by RequireJS by default

So something like that:

function outputText(){

    require(["//tinymce.cachefly.net/4.2/tinymce.min"], function() {

        tinyMCE.init({

        mode: "textareas",

        theme: "simple"

        });

     

  });

};

Not tested ... but that's the direction I think.

Please mark the appropriate replies as correct or helpful so our team and other members know that your question has been answered to your satisfaction.

Hope this helps!

Regards

Stefan

Not applicable

Re: Qlik Sense Server Mashup - Referencing external javascript library

Hi Stefan,

That worked - Thanks for your help!

Cheers,

Joel

Community Browser