2012-02-09 16 views
0

Eclipseで単純な静的Webプロジェクトを作成しました。 WebContentフォルダにjquery.jsとjquery.dataTables.jsをダウンロードしました。シンプルなjQueryデータを使って外部URLを読み込めませんテーブル

{

"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]" 
    ], 

... }

<!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> 

http://localhost:8080/myProj/listLogs?messageId=33333333333からJSON応答は次のようになります。そして、私はこのようになりますindex.htmlページを作成しましたしかし、私がfirefoxでindex.htmlを開くと、何もロードされません。私はこのページにこれを見ています:

stuff 
stuff 
Loading... 
Showing 0 to 0 of 0 entries 
PreviousNext 

私のJSON URLも呼び出されませんでした。理由は分かりません。

+0

http://JSONLint.comを使用してJSONを検証することが – Devjosh

+0

ちょうどでし有効ではありません。それは有効です。私が言ったように、URLは呼び出されません。私はサーバー側で監視することで分かります。 – scabbage

+0

firebugのコンソールやfirefoxのネットパネルのXHRタブからのXHRリクエストを参考にして、URLの呼び出しで500の内部サーバーエラーや404エラーなどのエラーが発生したかどうかを確認し、 patは正しい – Devjosh

答えて

関連する問題