The code is working on a stack fragment other than a single html file

I have a code and it works fine with a piece of code.

But when I paste it to my server or just .html file the refresh button gets smaller!

enter image description here

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

Run codeHide result


There is a COPY code and a PASTE code, no difference! Are there some pen snippets to make it work and how can I get it to work on my server? More information on the previous question .
+3


source to share


1 answer


Make sure you give the doctype when moving code into native html file. Stack snippets and JS Fiddle automatically add HTML document type <!DOCTYPE html>

to their output (although this is configurable in JS Fiddle case). Failure to provide a doctype can lead to odd results because the browser doesn't know which rendering mode to use.

Taken from http://www.w3.org/QA/Tips/Doctype :



But most importantly, with most browser families, the doctype declaration will make a lot of guessing unnecessary and thus trigger a "standard" rendering mode.

+2


source







All Articles