Foren
How to let jQuery work inside THEME not plugin
Al-Mothafar Al-Hasan, geändert vor 11 Jahren.
How to let jQuery work inside THEME not plugin
Regular Member Beiträge: 110 Beitrittsdatum: 06.12.09 Neueste Beiträge
Hi,
I have issue with calling jquery files to theme in Lfieray 6.1 !
I'm upgrading themes from liferay 5.2 to 6.1, my problem is when I call jQuery and libraries, and i have a lot of custom & complex codes with jquery, when i do normal jquery call nothing work even !
like :
and I called jQuery library in many ways nothing working like :
or
or
And i searched a lot in forum most talking about plugin solutions but here I'm talking about theme !
I tried :
and worked, but I cant call jQuery from online CDN, because I have test environment offline.
so how I solve this !
I have issue with calling jquery files to theme in Lfieray 6.1 !
I'm upgrading themes from liferay 5.2 to 6.1, my problem is when I call jQuery and libraries, and i have a lot of custom & complex codes with jquery, when i do normal jquery call nothing work even !
like :
<script type="text/javascript">
$(function(){
alert("Hello" );
});
</script>
and I called jQuery library in many ways nothing working like :
<script src="$themeDisplay.getPathThemeJavaScript()/jquery.min.js" type="text/javascript"></script>
or
<script type="text/javascript" src="$javascript_folder/jquery.min.js" charset="utf-8"></script>
or
#js ("$javascript_folder/jquery.min.js")
And i searched a lot in forum most talking about plugin solutions but here I'm talking about theme !
I tried :
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
and worked, but I cant call jQuery from online CDN, because I have test environment offline.
so how I solve this !
Gaurav Jain, geändert vor 11 Jahren.
RE: How to let query work inside THEME not plugin
Regular Member Beiträge: 145 Beitrittsdatum: 31.01.11 Neueste Beiträge
Did you check if your theme really has jquery.min.js file in your theme>docroot>_diffs>js folder !!!
Gaurav Jain, geändert vor 11 Jahren.
RE: How to let query work inside THEME not plugin
Regular Member Beiträge: 145 Beitrittsdatum: 31.01.11 Neueste Beiträge
Just to mention that all 3 ways of yours are just fine to inherit js files