首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >代码在与单个html文件不同的堆栈片段上工作。

代码在与单个html文件不同的堆栈片段上工作。
EN

Stack Overflow用户
提问于 2015-05-08 14:57:19
回答 1查看 84关注 0票数 3

我有一些代码,它在堆栈代码段上运行得很好。

但是,当我将它插入到我的服务器上或仅仅在.html文件中时,刷新按钮就会变小!

代码语言:javascript
复制
<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>

有复制和粘贴的代码,没有不同的!是否有一些片段羽毛使它工作,我如何使它在我的服务器上工作?更多关于我以前的question的信息。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-08 15:21:26

在将代码移动到自己的html文件时,请确保指定了doctype。堆栈片段和JS自动将HTML5文档类型的<!DOCTYPE html>添加到它们的输出中(尽管在JS的情况下这是可配置的)。不提供doctype会导致奇怪的结果,因为浏览器不知道使用什么呈现模式。

采自http://www.w3.org/QA/Tips/Doctype

但最重要的是,在大多数浏览器家族中,一个doctype声明将使许多猜测变得不必要,从而触发“标准”呈现模式。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30126886

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档