AEM6.5 referencing external js in clientlib

Avatar

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
Level 4
srinivas_chann1
Level 4

Likes

21 likes

Total Posts

222 posts

Correct reply

6 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
srinivas_chann1
Level 4

09-03-2021

Hi ,

 

I have 2 js scripts in header of html  which we are adding as 

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/ angular.min.js "></script>;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

 

 

So want to add this to clientlibs of aem, but wanted to know instead of copying the whole js code inside the clientlibs . Is there any way I could reference this js with just urls and still gets  these added clientlibs of aem.

 

The idea in case they the 3party scripts if there is any code change in js it will automatically get reflected instead of making a code change again

 

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

10-03-2021

Hi @srinivas_chann1,

We need to define the source files of desired JS libraries in clientlibs.

Referencing JS with URLs is possible only with <script> tag which is the case for HTML. 

Note : jQuery library that ships with AEM OOTB is included as source files of specific version in clientlibs.

 

Answers (0)