Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Al-Mothafar Al-Hasan
How to let jQuery work inside THEME not plugin
26. März 2013 04:46
Antwort

Al-Mothafar Al-Hasan

Rang: Regular Member

Nachrichten: 110

Eintrittsdatum: 6. Dezember 2009

Neue 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 :
1<script type="text/javascript">
2  $(function(){
3    alert("Hello" );
4    });
5</script>


and I called jQuery library in many ways nothing working like :

1<script src="$themeDisplay.getPathThemeJavaScript()/jquery.min.js" type="text/javascript"></script>

or
1<script type="text/javascript" src="$javascript_folder/jquery.min.js" charset="utf-8"></script>

or
1#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 :
1<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
RE: How to let query work inside THEME not plugin
24. Dezember 2012 03:29
Antwort

Gaurav Jain

Rang: Regular Member

Nachrichten: 146

Eintrittsdatum: 31. Januar 2011

Neue Beiträge

Did you check if your theme really has jquery.min.js file in your theme>docroot>_diffs>js folder !!!
Gaurav Jain
RE: How to let query work inside THEME not plugin
24. Dezember 2012 03:42
Antwort

Gaurav Jain

Rang: Regular Member

Nachrichten: 146

Eintrittsdatum: 31. Januar 2011

Neue Beiträge

Just to mention that all 3 ways of yours are just fine to inherit js files