Hi Rewati,
When you create the theme or the portlet with the help of ANT or MAVEN, it will default create the Structure for you.
You will have js,css,html,images etc. folder inside it. So put all the js files in the JS folder, images inside images folder etc.
So if you use in theme, then you can directly access with the help of $javascript_folder(it will use you the path upto javascript) .
So if you are using main.js then in the theme just need to write as below :-
1<script type="text/javascript" src="$javascript_folder/main.js"></script>
And same way for the other JS files in theme.
For more details check
this.
In the portlet you can use as below :-
1
2<script type="text/javascript" src="<%=themeDisplay.getPathThemeJavaScript()%>/main.js"></script>
Hope I am clear.
Regards,
Amit Doshi
Please sign in to flag this as inappropriate.