Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
node.js-日期选择器jquery UI不工作_Jquery_Jquery Ui_Node.js - Fatal编程技术网

node.js-日期选择器jquery UI不工作

node.js-日期选择器jquery UI不工作,jquery,jquery-ui,node.js,Jquery,Jquery Ui,Node.js,我试图在node.js项目中使用JQuery UI datepicker,但它不起作用 layout.ejs和index.ejs文件的简化版本 layout.ejs <head> <script type="text/javascript" src="../1.4.2/jquery.min.js"></script> <script type="text/javascript" src="../1.8.11/jquery-ui.min.js">&l

我试图在node.js项目中使用JQuery UI datepicker,但它不起作用

layout.ejs和index.ejs文件的简化版本

layout.ejs

<head>
<script type="text/javascript" src="../1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="../1.8.11/jquery-ui.min.js"></script>
<link rel="stylesheet" href="../jquery-ui.css" type="text/css" media="all" />
</head>
<body>
      <script>
         $(function() {
            $( "#datepick" ).datepicker();
        });
     </script>
</body>
</html>

$(函数(){
$(“#datepick”).datepicker();
});
index.ejs

<aside class="widget">
    <p>Date: <input type="text" id="datepick"></p>
</aside>

日期:


工作演示

再次检查您的脚本源代码,最好将其更改为下面的google链接;在RiightSource的演示中,您可以看到所有这些都很好地工作

希望有帮助<代码>:)

脚本

 <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" media="all">

  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

工作演示

再次检查您的脚本源代码,最好将其更改为下面的google链接;在RiightSource的演示中,您可以看到所有这些都很好地工作

希望有帮助<代码>:)

脚本

 <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" media="all">

  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

下面的代码可以在带有nodejs/express的EJS模板引擎中运行 Layout.ejs

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" media="all">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
    <script>
    $(function() {
        $('#datepick').datepicker();
    });
    </script>

</head>  
<body>
</body>
</html>

$(函数(){
$('#datepick')。datepicker();
});
Index.ejs

<aside class="widget">
<p>Date: <input type="text" id="datepick"></p>

日期:


以下代码可以在带有nodejs/express的EJS模板引擎中运行 Layout.ejs

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" media="all">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
    <script>
    $(function() {
        $('#datepick').datepicker();
    });
    </script>

</head>  
<body>
</body>
</html>

$(函数(){
$('#datepick')。datepicker();
});
Index.ejs

<aside class="widget">
<p>Date: <input type="text" id="datepick"></p>

日期:


“它不起作用。”但问题到底是什么?当你运行它时会发生什么?此外,这些外部js文件是否成功导入?当我单击日期字段时,我没有看到datepicker对话框。没有外部js文件。为了清晰起见,我设置了谷歌cdn链接的格式。“它不起作用。”但问题到底是什么?当你运行它时会发生什么?此外,这些外部js文件是否成功导入?当我单击日期字段时,我没有看到datepicker对话框。没有外部js文件。为了清晰起见,我格式化了谷歌cdn链接。这些是我为了清晰而编辑的谷歌链接。我不知道为什么它不起作用。事实上,在发布到这里之前,我在JSFIDLE中尝试了我的源代码,并且效果良好。我不只是在我的环境中工作。@Vinoth-Aha;那一定是别的,你想检查控制台有没有错误等,让我知道如果没有帮助我会删除这篇文章,这些是我为了清晰起见编辑的谷歌链接。我不知道为什么它不起作用。事实上,在发布到这里之前,我在JSFIDLE中尝试了我的源代码,并且效果良好。我不只是在我的环境中工作。@Vinoth-Aha;那一定是别的,你想检查控制台有没有错误等,让我知道如果没有帮助,我会删除这篇文章,