【问题标题】:Zebra Datepicker - Not working斑马日期选择器 - 不工作
【发布时间】:2015-12-16 03:24:02
【问题描述】:

我正在尝试使用 Zebra Datepicker jQuery 插件创建日期选择器。

我所做的是-

<html>
  <head>
    <link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.0.3/css/buttons.dataTables.min.css">
    <script type="text/javascript" language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script type="text/javascript" language="javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

        <!-- This 2 for jQuery UI -->
        <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" language="javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

        <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.0.3/js/dataTables.buttons.min.js"></script>
        <script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.0.3/js/buttons.colVis.min.js"></script>

<link rel="stylesheet" type="text/css" href="https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/master/public/css/bootstrap.css">

<script type="text/javascript" language="javascript" src="https://raw.githubusercontent.com/stefangabos/Zebra_Datepicker/master/public/javascript/zebra_datepicker.src.js"></script>

  </head>
  <body>
        <input type="text" id="#datepicker-example1" name="anything" value="nai" placeholder="datepicker">
  </body>

    <script>
            $( document ).ready(function()
            {
                $('#datepicker-example1').Zebra_DatePicker();
            });
    </script>

</html>

但它不起作用。

有人可以帮忙吗?

【问题讨论】:

  • 尝试下载 .js 和 .css 文件。不要从 Git 使用

标签: javascript jquery datepicker zebra


【解决方案1】:

确保按照创作者网站上的说明添加&lt;doctype&gt;

http://stefangabos.ro/jquery/zebra-datepicker/

Zebra_Datepicker 除了 jQuery 1.5.2+ 之外没有其他依赖项,但是 要求您使用插件的页面具有严格的 文档类型:

&lt;!doctype html&gt;

另外,不要尝试从 git 远程获取脚本,而是在本地下载它们。

Git 不是 CDN,我怀疑您的请求被拒绝了。

【讨论】:

    猜你喜欢
    • 2015-02-28
    • 2010-09-22
    • 2014-07-21
    • 1970-01-01
    • 2015-10-22
    • 2017-12-24
    • 2016-06-27
    相关资源
    最近更新 更多