数据表不能在Firefox中工作,但适用于IE和Chrome

时间:2017-10-30 17:01:39

标签: jquery firefox datatables

我尽力在网上重新创建这个。它在Chrome和IE中运行良好,但在Firefox中不起作用。它因类型错误而失败。它记录了我在本地收到的同一错误http://jsfiddle.net/shorif2000/pq60mesq/5/

$(document).ready(function() {
  $('#dt-comms_matrix').dataTable({});
});
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jq-3.2.1/jszip-2.5.0/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-html5-1.4.2/b-print-1.4.2/fc-3.2.3/fh-3.1.3/r-2.2.0/datatables.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.2.1/jszip-2.5.0/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-html5-1.4.2/b-print-1.4.2/fc-3.2.3/fh-3.1.3/r-2.2.0/datatables.min.js"></script>

<body>
  <div class="container">

    <table id="dt-comms_matrix" class="table display compact table-condensed table-vf table-bordered dataTable" style="width:3430px;max-width:none;">
      <thead>
        <tr>
          <th colspan="22" style="text-align: center;"><a style="float:left; color: #fff !important;" href="/api/user/commsmatrix/aggr/id/442/format/xml">
                                                    Click here to view aggr table
                                                </a><a style="float:left; color:#fff  !important; padding-left:10px" href="/api/user/commsmatrix/id/442/firewalls/format/xml
                                                    ">
                                                    Click here to view Firewall
                                                </a> Security Flows
          </th>
        </tr>
        <tr>
          <th>
            Actions
          </th>
          <th>
            ID
          </th>
          <th>
            Row
          </th>
          <th style="width: 155px;padding-bottom:10px">
            Status
            <small class="hidden-print">(Select the tick boxes to set status for all rows)
                                                    </small>
            <br class="hidden-print">
            <input name="statuses" id="user_commsmatrix_statuses_chk" onclick="user_commsmatrix_statuses_select_unselect_all()" class="form-control hidden-print" type="checkbox">
            <select id="user_commsmatrix_statuses_s" name="user_commsmatrix_statuses_s" class="form-control hidden-print">
              <option value="In progress">In progress</option>
              <option value="To implement">To implement</option>
              <option value="Implemented">Implemented</option>
              <option value="To remove">To remove</option>
              <option value="Removed">Removed</option>
            </select>
            <input style="width: unset;padding-left: 5px;padding-right: 5px;" id="check_dependencies" class="btn-sm btn-default hidden-print" value="check dependencies" onclick="checkToRemove()" type="button">
          </th>
          <th style="width:125px">
            INC
            <small class="hidden-print">(Enter here to update for all rows)</small>
            <input id="inc_all" name="inc_all" maxlength="15" size="15" class="form-control hidden-print" type="text">
          </th>
          <th>
            Source
          </th>
          <th>
            Description
          </th>
          <th>
            Zone
          </th>
          <th>
            Destination
          </th>
          <th>
            Description
          </th>
          <th>
            Zone
          </th>
          <th>
            Protocol
          </th>
          <th>
            Ports
          </th>
          <th>
            Environment
          </th>
          <th>
            Remarks
          </th>
          <th>
            Security Policy Action
          </th>
          <th>
            Security Policy Note
          </th>
          <th>
            Routing Policy Action
          </th>
          <th>
            Routing Policy Note
          </th>
          <th>
            Firewall Policy Action
          </th>
          <th>
            Firewall Policy Note
          </th>
          <th>Enhanced Test</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td colspan="10" class="text-center"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i> Loading...</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      </tbody>
      <tfoot class="hidden-print">
        <td></td>
        <td></td>
        <td colspan="2" style="text-align:center"><a class="btn btn-domain hidden-print" onclick="submit_form_status()">Save</a></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tfoot>
    </table>
  </div>
</body>

</div>
</body>

我在Firefox中收到的错误是

jQuery.Deferred exception: i is undefined Ja@https://ccp-test.domain.com/assets/datatables/datatables.min.js:93:271
N@https://ccp-test.domain.com/assets/datatables/datatables.min.js:85:337
oa/<@https://ccp-test.domain.com/assets/datatables/datatables.min.js:85:450
map/<@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:162:11
map@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:451:13
map@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:161:26
oa@https://ccp-test.domain.com/assets/datatables/datatables.min.js:85:413
e@https://ccp-test.domain.com/assets/datatables/datatables.min.js:161:431
m/<@https://ccp-test.domain.com/assets/datatables/datatables.min.js:162:118
each@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:362:10
each@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:157:10
m@https://ccp-test.domain.com/assets/datatables/datatables.min.js:151:457
h.fn.DataTable@https://ccp-test.domain.com/assets/datatables/datatables.min.js:236:289
@https://ccp-test.domain.com/javascripts/ccp.js?1509382029:771:26
mightThrow@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:3583:21
resolve/</process<@https://ccp-test.domain.com/assets/jquery/dist/jquery.js:3651:12
 undefined

1 个答案:

答案 0 :(得分:-1)

如果删除标题的第一个单元格中的链接(如下所示),则可以正常工作。您的问题在该HTML代码中。

删除此

<a style="float:left; color: #fff !important;" href="/api/user/commsmatrix/aggr/id/442/format/xml">
    Click here to view aggr table                                                 
</a>
<a style="float:left; color:#fff  !important; padding-left:10px" href="/api/user/commsmatrix/id/442/firewalls/format/xml">
    Click here to view Firewall
</a>

然后你可以向后工作将其添加回来或将它放在桌子外面。