Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Call to external libraries within Publishing

Hello there,

I am desperatly trying to use javascript external (i.e. not functions in a javascript code palette element) libraries (for instance jquery.js or underscore.js) in a Publishing template.
But I can't manage to get through!

My wish is to be able:
1°) Ideally to put a reference(same principle as in html pages, e.g. <script src="jquery-3.6.3.js"></script>) somewhere in Publishing document studio.
2°) if reference are not possible, what code structure to use for copying and pasting ? I tried to paste the code of the jquery-3.6.3.js file and it yielded errors.

Thanks in advance for your help.
Regards
Alioun

0 votes

Comments

Hi Alioune,


As far as I know, you would not be able to add javascript external call directly from a template. You would need to use PUB javascripting capability to extent it but I am not sure if this is possible. Searching https://stackoverflow.com/, I see quite a bit of responses where using external libraries with javascript. Also, PUB javascripting is valuable for PUB customers but it is provided as-is, so this community is good place to seek answer. Thanks for raising this question.

It would help if you could provide your details of your use case as there might be other ways to solve your problem.

Hi there Fariz,
Thanks for this clear answer.
FYI I have no particular use case to supply you with. This was a general question asked by several customers and I wanted to have a clear status on the topic.
As for me, using code from libraries via javascript code import in a javascript code element of a PUB template is fine enough.
Kind regards
Alioune


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,033

Question asked: Mar 14 '23, 9:08 a.m.

Question was seen: 1,462 times

Last updated: Mar 16 '23, 4:49 a.m.

Confirmation Cancel Confirm