2016-07-06 4 views
1

現在、私はすべてのページに問題があります。送信ボタンとボタンを含む表がページに含まれています。編集ボタンをクリックするたびに問題が発生しますthe tablecssおよびjavascriptはなくなりました。ここでCSSボタンをクリックするとJavaScriptが消えます

はここjascriptコード

<script type="text/javascript"> 
    $(document).ready(function() { 
     var table = $('#datatable').dataTable(); 
     var tableTools = new $.fn.dataTable.TableTools(table, { 
      'aButtons' : [ ], 
      'sSwfPath' : 'js/copy_csv_xls_pdf.swf' 

     }); 

     $(tableTools.fnContainer()).insertBefore('#datatable_wrapper'); 
    }); 
</script> 

テーブル

<table id="datatable" class="hover" > 
       <thead> 

      <tr> 
       <th width="80">Poll ID</th> 
       <th width="120">Poll Name</th> 
       <th width="120">Poll Description</th> 
       <th width="120">poll publisher</th> 


       <th width="60">Edit</th> 
       <th width="60">Delete</th> 
       <th width="60">Voter</th> 
           <th width="60">Afficher courbe</th> 

      </tr> 
      </thead> 
       <tfoot> 

      <tr> 
       <th width="80">Poll ID</th> 
       <th width="120">Poll Name</th> 
       <th width="120">Poll Description</th> 
       <th width="120">poll publisher</th> 


       <th width="60">Edit</th> 
       <th width="60">Delete</th> 
       <th width="60">Voter</th> 
           <th width="60">Afficher Courbe</th> 

      </tr> 
      </tfoot> 
      <c:forEach items="${listpolls}" var="poll"> 
        <tbody> 

       <tr> 
        <td>${poll.id_poll}</td> 
        <td>${poll.titre}</td> 
        <td>${poll.description}</td> 
        <td>${poll.emp_login}</td> 



        <td><a href="<c:url value='/poll/edit/${poll.id_poll}' />">Edit</a></td> 
        <td><a href="<c:url value='/poll/remove/${poll.id_poll}' />">Delete</a></td> 
        <td><a href="<c:url value='/poll/voter/${poll.id_poll}' />">Vote</a></td> 
        <td><a href="<c:url value='/sa/${poll.id_poll}' />">Afficher courbe</a></td> 

       </tr> 
      </c:forEach> 
          </tbody> 

     </table> 

である私が編集をクリックする前に、テーブルの写真です。

enter image description here

そして今

enter image description here

あなたはCSSとjavasciptコードの両方がなくなっている見ることができるように。

私はここで間違っていますか?どんな助けでも大歓迎です。

+0

あなたは '/ poll/edit/$ {poll.id_poll}'ページに行っているようですが、CSSとJSはそのWebページに存在していますか? –

+0

実際に**/poll/edit/$ {poll.id_poll} **は同じページにリダイレクトされます。 –

+0

ブラウザの[ネットワーク]タブのCSSおよびJS要求URLをページのリダイレクト前後で比較します。 –

答えて

0

リンクのhrefに問題があります。/poll/edit/...などです。リダイレクトされたとしても、ブラウザはあなたのスタイルへの相対パスが&のスクリプトとは別のディレクトリにあると考えています。

ページ上のすべてのリンクのためのベースディレクトリを指定します。
<base href="http://www.domain.com/somebasedir/" />

その後に関係なくリダイレ​​クトの、例えばこのスタイルシート:
/somebasedir/path/style.css


<link rel="stylesheet" type="text/css" href="path/style.css" />

は常にで探されるべき

+0

**基本的なものを追加し、** **を** **働いていただきありがとうございます。 –

関連する問題