留言板

$.cookie is not a function issue in liferay

bo liu,修改在6 年前。

$.cookie is not a function issue in liferay

New Member 帖子: 9 加入日期: 17-7-20 最近的帖子
Hi, I've been struggling with $.cookie is not a function issue for the past week. This error only exists in liferay, I didn't see this in webcenter on weblogic. In the portlet, we are using one jQuery menu accordion plugin, and that plugin needs to call a cookie js file, the following is the javascript files we imported:

<script language="JavaScript" src="../js/jquery-1.11.3.min.js"></script>
<script language="JavaScript" src="../js/jquery.cookie.js"></script>
<script language="JavaScript" src="../js/jquery.hoverIntent.minified.js"></script>
<script language="JavaScript" src="../js/jquery.dcjqaccordion.2.7.js"></script>

I've already done lots of research on this issue, and tried many possible solutions such as changing the cookie file's name, changing to another plugin, changing the import order, etc. But unfortunately none of them works. I'm thinking is this issue liferay-specific, is there any way I can configure in liferay to fix it? Thanks!
thumbnail
David H Nebinger,修改在6 年前。

RE: $.cookie is not a function issue in liferay

Liferay Legend 帖子: 14918 加入日期: 06-9-2 最近的帖子
bo liu:
I've been struggling with $.cookie is not a function issue for the past week.


Do not rely on $ being an alias for jQuery. Try the full jQuery.cookie() syntax instead.








Come meet me at Devcon 2017 or 2017 LSNA!