Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Matt W
Liferay 6.0.2RC and jQuery
June 25, 2010 11:39 AM
Answer

Matt W

Rank: New Member

Posts: 4

Join Date: July 16, 2009

Recent Posts

Is there anything that would have changed with the move from 6.0.1RC to 6.0.2RC with respect to the use of jQuery in custom themes? I was using jQuery for a custom theme under 6.0.1RC and it seemed to work fine and now that we've moved to 6.0.2RC it breaks the javascript. If it helps, we get a bunch of "Error: $ is not defined" errors now in Firefox error console.

Perhaps we didn't call jQuery correctly to begin with, but it was being loaded in portal_normal.vm as follows when it worked under 6.0.1RC:

<!DOCTYPE html>

#parse ($init)

<html dir="#language("lang.dir")" lang="$w3c_language_id">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>$the_title - $company_name</title>

$theme.include($top_head_include)

<script type="text/javascript" src="$javascript_folder/jquery.min.js?ver=1.4.2"></script>

<!-- For Lightbox -->
<script type="text/javascript" src="$javascript_folder/lightbox/sexylightbox.v2.4.jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
SexyLightbox.initialize({
color : 'white',
find : 'lightbox',
dir : '$javascript_folder/lightbox/sexyimages' // CHANGE THIS
});
});
</script>
<!-- End Lightbox -->

<!-- Init JS Theme -->
<script type="text/javascript" src="$javascript_folder/theme.js"></script>
<!-- End Theme -->

Can anyone point me in the right direction?

Thanks
Jonathan Neal
RE: Liferay 6.0.2RC and jQuery
June 25, 2010 11:45 AM
Answer

Jonathan Neal

LIFERAY STAFF

Rank: Junior Member

Posts: 66

Join Date: August 29, 2007

Recent Posts

Matt W:
<script type="text/javascript" src="$javascript_folder/jquery.min.js?ver=1.4.2"></script>


I'd double check the way you are adding jQuery onto the page. I've never heard of passing "?ver=1.4.2" in.
ismail başaran
RE: Liferay 6.0.2RC and jQuery
July 21, 2010 1:43 AM
Answer

ismail başaran

Rank: New Member

Posts: 15

Join Date: October 8, 2009

Recent Posts

i have the same problem. i am trying to add accordion menu but jquery is not working. Matt W did you find any solution ?
Aaron Bryenton
RE: Liferay 6.0.2RC and jQuery
July 21, 2010 7:27 AM
Answer

Aaron Bryenton

Rank: Junior Member

Posts: 53

Join Date: May 28, 2010

Recent Posts

I was having the same problem with my jQuery based menu.

I ended up adding:

1<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
2<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>   


to the top of my portal_normal.vm in my _diffs folder.