Я создал простой статический веб-проект в Eclipse. Я загрузил jquery.js и jquery.dataTables.js в свою папку WebContent. Затем я создал страницу index.html, которая выглядит следующим образом:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable({
"sAjaxSource" : 'http://localhost:8080/myProj/listLogs?messageId=33333333333'
});
});
</script>
<title>Insert title here</title>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" class="display"
id="example">
<thead>
<tr>
<th>stuff</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th>stuff</th>
</tr>
</tfoot>
</table>
</body>
</html>
Ответ JSON от http://localhost:8080/myProj/listLogs?messageId=33333333333 должен выглядеть следующим образом:
{
"aaData": [
[
"This is a NEW message"
],
[
"Parsing message with messageId = 33333333333 and eventType = CREATE"
],
[
"Start running workflow with 4 actions"
],
[
"Updating entitlement for event: [33333333333:CREATE]"
],
...
}
Но когда я открываю index.html в моем firefox, ничего не загружается. Я вижу это на странице, хотя:
stuff
stuff
Loading...
Showing 0 to 0 of 0 entries
PreviousNext
Мой URL JSON даже не вызывался. Не знаю почему.