dependent js file is not being accessed in component | Community
Skip to main content
GK-007
Level 9
October 16, 2015
Solved

dependent js file is not being accessed in component

  • October 16, 2015
  • 7 replies
  • 1412 views

Hi All,

 

I have created component which has reference to jquery and third party corousel js's.I have created client lib node and created js.txt and updated these js information.

Below error seeing on browser console.

 Uncaught TypeError: undefined is not a functiontravelCorousel.html:19 (anonymous function)clientlibs.js:3143 jQuery.Callbacks.fireclientlibs.js:3255 jQuery.Callbacks.self.fireWithclientlibs.js:3467 jQuery.extend.readyclientlibs.js:3498 completed.

Can someone help me how to fix this issue and for you reference i have attached component structure screen-shot as well.

Thanks In Advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by GK-007

i have resoleved this issue and i made below changes only.

(1) I have removed "dependecies" property for clientLib node.

(2) I have kept only categories property and value as "cq.jquery"

Thanks for showing interest and your time in troubleshooting this issue.

7 replies

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

make sure you serve your css/js files from /etc/designs or /etc/clientlib.

the /apps folder is locked down on publish.

GK-007
GK-007Author
Level 9
October 16, 2015

Thanks Feike for your quick response and as of now i am trying in author only but not getting desired results.

I will try as you suggested and i have question here is even if want to test it in author also do I need to maintain j's/css file in /etc/designs.

Thanks,

Kishore

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

Ah ok. I though the issue was on publish.

Any errors/warnings in your error.log?

How does you js.txt look like?

GK-007
GK-007Author
Level 9
October 16, 2015

I am not seeing any error in error.log.

This error i am seeing on browser console."Uncaught TypeError: undefined is not a function".

The text inside the js.txt is as below.

#base=.
jquery-1.11.2.js
jquery.infinitecarousel.js

Thanks,

Kishore

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

can you remove the #base=. line?

Can you make a screenshot of your clientlibs-definition?

And the way how you include them into the page?

GK-007
GK-007Author
Level 9
October 16, 2015

(1)  i have icluded "cq:includeClientLib" tag to get reference of client libs.

<cq:includeClientLib categories="jquerysamples" /> 

(2)I have tried by removing #base=. line but still getting same issue.

Thanks,

Kishore

GK-007
GK-007AuthorAccepted solution
Level 9
October 16, 2015

i have resoleved this issue and i made below changes only.

(1) I have removed "dependecies" property for clientLib node.

(2) I have kept only categories property and value as "cq.jquery"

Thanks for showing interest and your time in troubleshooting this issue.