cant load /apps/appname/components/structure/page/x.js in AEM publsher.

Avatar

Avatar
Validate 1
Level 2
JakeCham
Level 2

Likes

6 likes

Total Posts

75 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
JakeCham
Level 2

Likes

6 likes

Total Posts

75 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
JakeCham
Level 2

01-11-2019

I have an external js file.i called it in main.html like <script type="text/javascript" src="/apps/appname/components/structure/page/x.js"></script>.But cant load it  in AEM publsher.In AEM author it is loading to the related js file.Purpose of doing this is I have a java script code for eloqua form submission which is inside main.html.Because of eloqua js is inside main.html as internal js it is affecting to page loading time.So i have to put that js as an external and call.Either this way <div data-sly-use.page="${'x.js'}"/> is not working because eloqua js is returning nothing.

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,442 likes

Total Posts

3,314 posts

Correct reply

941 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

01-11-2019

Please use proxy clientlibs and include using etc./Clientlibs/

check Using Client-Side Libraries

Avatar

Avatar
Validate 1
Level 2
JakeCham
Level 2

Likes

6 likes

Total Posts

75 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 2
JakeCham
Level 2

Likes

6 likes

Total Posts

75 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
JakeCham
Level 2

03-11-2019

I put it under /etc/designs/app/clientlibs and check.but it is showing an error which is _elqQ is not defined.Eloqua.js is calling this Library.//img.en25.com/i/elqCfg.min.js.So that can we get eloqua js outside from main.html ? error is _elqQ is not defined.Note - in this case it is not under apps. so allowproxy:false is okay cas it is not under apps.

Avatar

Avatar
Give Back 5
MVP
Umesh_Sondhi
MVP

Likes

56 likes

Total Posts

64 posts

Correct reply

28 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 50
Boost 5
View profile

Avatar
Give Back 5
MVP
Umesh_Sondhi
MVP

Likes

56 likes

Total Posts

64 posts

Correct reply

28 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 50
Boost 5
View profile
Umesh_Sondhi
MVP

14-11-2019

Please try following steps:

  •     Create a separate javascript file for eloqua script containing the code
  •     Call the above file using dependencies attribute into your clientlib folder

    1855186_pastedImage_2.png

   

Hope it helps!