3

いくつかのコードがあり、スタック スニペットで正常に動作します。

しかし、サーバーまたは.htmlファイルに挿入すると、更新ボタンが小さくなります!

ここに画像の説明を入力

<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/>
<link href="http://cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.1.4/jquery.bootgrid.css" rel="stylesheet"/>

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.1.4/jquery.bootgrid.js"></script>


<script>
 $(function () {
      var testGrid = $("#testGrid").bootgrid({
        navigation: 3,
        ajax: true,
        url: "controllers/getListFiles",
        post: function () {
          return {
            type: 'req',
            expanded: $('#exp').text()
          };
        },
        responseHandler: function (response)
        {
          return response.data;
        }
      });
    });
</script>



    <div id="autoOut" class="tab-pane fade in active">
      <span id="exp" style="display: none;"></span>
      <h3>Auto OUT</h3>
      <table id="testGrid" class="table table-condensed table-hover table-striped">
        <thead>
          <tr>
            <th data-column-id="date" class="col-md-3">Дата/Время</th>
            <th data-column-id="expander" data-formatter="expander" class="col-md-1">Список</th>
            <th data-column-id="file" class="col-md-4">Имя файла</th>
            <th data-column-id="uid" class="col-md-4">UID</th>
            <th data-column-id="accReqId" class="col-md-2">AccountsRequestId</th>
          </tr>
        </thead>
      </table>
    </div>
コードのコピーと貼り付けがありますが、違いはありません! それを機能させるいくつかのスニペットフェザーはありますか?どうすれば私のサーバーで機能させることができますか? 私の以前の質問の詳細。

4

1 に答える 1

2

コードを独自の html ファイルに移動するときは、必ず doctype を指定してください。スタック スニペットと JS Fiddle は、HTML5 doctype<!DOCTYPE html>を出力に自動的に追加します (ただし、JS Fiddle の場合、これは構成可能です)。doctype を指定しないと、ブラウザーが使用するレンダリング モードを認識できないため、奇妙な結果が生じる可能性があります。

http://www.w3.org/QA/Tips/Doctypeから取得:

しかし、最も重要なことは、ほとんどのブラウザー ファミリでは、doctype 宣言によって多くの推測が不要になり、「標準」レンダリング モードがトリガーされることです。

于 2015-05-08T15:21:26.707 に答える