Hi All,
My html structure is as follows,
<html> <head> <cq:includeClientLib css="my.categories" /> </head> <body> <!--Header Files--> <!--Navigation files--> <!--Main Body Starts here--> <!--Component that uses jQuery--> $(document).load(function(){ //do something }); <!--Footer part starts here --> <footer> <cq:includeClientLib js="cq.jquery" /> <cq:includeClientLib js="my.categories" /> </footer> </body> </html>
Since i am loading the jQuery clientlib at the footer the jquery in the component is not working. It says $ is not defined.
In such case is it impossible to use jQuery? Kindly let me know how i can proceed!!!
Thanks,
Jai.
Solved! Go to Solution.
Views
Replies
Total Likes
Get you now, as you probably know putting the call to load the client libraries at the bottom is done to improve page load times [1][2].
I'd explain your issue to the tech lead or try what Praveen suggested.
Regards,
Opkar
[1] https://developer.yahoo.com/performance/rules.html#js_bottom
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Edubey,
I am making an ajax call to a servlet and processing the JSON response to populate a div in the component.
I referred some article that is similar to the one described here
Views
Replies
Total Likes
Hi,
in the first article referenced by the link you posted [1], they add jquery as a dependency to their custom client library. This is preferable to making a separate call to load jquery. Any reason you were loading JQuery in the footer?
Regards,
Opkar
Views
Replies
Total Likes
Yes Opkar, if i add jquery as a dependency to my clientlib and i load my clientlib first in my component then for sure the component works.
But i do not know why they are loading jquery in the footer. This is the process they follow in this project and i am new to this project
Views
Replies
Total Likes
Get you now, as you probably know putting the call to load the client libraries at the bottom is done to improve page load times [1][2].
I'd explain your issue to the tech lead or try what Praveen suggested.
Regards,
Opkar
[1] https://developer.yahoo.com/performance/rules.html#js_bottom
Views
Replies
Total Likes
Here is an article you may fine useful [1]
[1] http://technologyplatforms.razorfish.com/blog/avoid-paying-jquery-tax-adobe-cq
Views
Replies
Total Likes
Thanks for that Opkar, Am waiting for your response
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies