Jquery Datatables in a portlet <p>I have a portlet and one of its JSP pages contains a table populated with java objects:<br> Here is a sample code:</p> <pre><code>&lt;% {%&gt; &lt;table id="logtable"&gt; &lt;thead&gt; &lt;tr&gt;&lt;th&gt;From&lt;/th&gt;&lt;th&gt;To&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;c:forEach var="message" items="${messages}"&gt; &lt;tr&gt; &lt;td&gt;&lt;c:out value="${message.sender}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;c:out value="${message.receiver}"/&gt;&lt;/td&gt; &lt;td&gt;&lt;c:out value="${message.timestamp}"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/c:forEach&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;% } %&gt; </code></pre> <p>I would like to make this table a DataTable using <a href="http://datatables.net/blog/Getting_started_with_DataTables%3a_First_steps" rel="nofollow">JQuery DataTables plugin</a>. I put the downloaded libraries in <code>docroot/js</code> folder in my Liferay portlet and set the path to it in <code>Liferay-portlet.xml</code> conf like this (as instructed in the tutorial I referenced):</p> <pre><code>&lt;header-portal-javascript&gt;/js/DataTables/media/js/jquery.js&lt;/header-portal-javascript&gt; &lt;header-portal-javascript&gt;/js/DataTables/media/js/jquery.dataTables.js&lt;/header-portal-javascript&gt; </code></pre> <p>Now the magic part comes - how do I actually init the dataTable from my example?</p> <p>I thought, that inserting the following script udner the table in my JSP (according to the tutorial) would do, but it does nothing:</p> <pre><code>&lt;script&gt; $(document).ready( function () { $('#logtable').dataTable(); } ); &lt;/script&gt; </code></pre> <p>What did I do wrong? Perhaps I did something wrong with specifying the path to my JQuery libraries... or am using it wrong? Should I call this function somewhere else? I am a newbie when it comes to JS and Jquery (sorry for dummy question), I just need to get this one thing working...</p> <p>EDIT: SOLVED by replacing <code>&lt;header-portal-javascript&gt;</code> with <code>&lt;header-portlet-javascript&gt;</code></p>