I'm attempting to add a searchable table to confluence using jquery data tables inside an html module. My original code which runs properly outside confluence is:
<!DOCTYPE html>
<html>
<head>
<title>Thumbnail Collection</title>
<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" language="javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#thumb_table').dataTable();
} );
</script>
</head>
<body>
<table id="thumb_table" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>ID</th>
<th>Last Modified</th>
<th>Thumbnail</th>
</tr>
</thead>
<tbody>
<tr>
<td>img_02</td>
<td>0x000000000046895e</td>
<td data-order=1354509177>2012-12-03 04:32:57</td>
<td><img src="https:/www.example.org/confluence/download/attachments/286745484/img_02?version=6&modificationDate=1408049585000&api=v2"></td>
</tr>
</tbody>
</table>
</body>
</html>I've tried using variations of:
AJS.$(document).ready(function() {
$('#thumb_table').dataTable();
} );without any luck.
Can anyone tell me how to reformat my html so it works properly inside confluence?