I want to Send data via AJax call to serlvet, the serlvet will return some result based to which I will redirect to a page. So where do I add this global .js file i.e the file that contains the AJAX call. PLEASE NOTE I'M USING PREDEFINED FORM COMPONENT AND A PREDEFINED TEMPLATE(Form Template) SO I CAN'T DO STUFF LIKE <cq: includeClientLibs> , as I don't have source code of component(form template).
I found a link where we add a global JS but I don't have this option in my CQ5 instance.
So Weird.http://www.sfu.ca/itservices/cms/howto/advanced/style-a-page/customjavascript.html
[img]weird.PNG[/img]
Solved! Go to Solution.
My preferred approach for this type of requirement (page specific CSS/JS) is to do the following:
Now you get the benefits of the client library framework but it can still be page specific.
Views
Replies
Total Likes
Hi,
I was about to post this question here in the forum, as I have the same problem as you, but for a distinct reason: I need to include some Javascript files that varies accordingly to the **page**, and not by templates.
For example, I have page-1 using file1.js, page-2 using file2.js, but both use template-A (and this does not let me use the client library).
What I did is to place my files inside /etc/clientlibs/my-project/my-custom-static-files-folder/file1.js, although my-custom-static-files-folder is not actually a client library, but just a folder to place those files.
And on the pages, I include the reference to the file placed inside the folder, like <script src="/etc/clientlibs/my-project/my-custom-static-files-folder/file1.js" ...>.
The bad part of this approach is that I can't take advantage of AEM's minification capabilities for those files.
If someone has a better approach, please let us know!
The typical way is to use clientlibs and <cq: includeClientLibs> to include JS libs and CSS. I have always used this standard way. However - i will research a way to do this without using clientlibs.
What version of CQ are you using?
Views
Replies
Total Likes
I would like to know how to do this in CQ 5.5 and 5.6
Views
Replies
Total Likes
My preferred approach for this type of requirement (page specific CSS/JS) is to do the following:
Now you get the benefits of the client library framework but it can still be page specific.
Views
Replies
Total Likes
Hi,
If the page component includes client libraries by category, you can create a new client library with the *same* category as an existing client library. You must have the source of the components. Aren't they just in JSP scripts in /apps/<something> ?
Justin
Views
Replies
Total Likes
Views
Likes
Replies