1

在挣扎了 2 天之后,我仍然无法集成 node+express+boilerplate 和一个简单的 JQuery 模块(日期选择器)。

作为最后的检查,我克隆了这个项目的新副本并添加了以下 4 行。它未能显示确认问题不在我的最后的日期提示。正常 html 项目上相同的 4 行代码可以工作。

我决定放弃这个,但应该有它不起作用的原因。我仍然无法弄清楚。

要克隆的项目: https ://github.com/mape/node-express-boilerplate

将这 4 行添加到 view 目录下的 layout.ejs 到 head 元素。

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

<p>Date: <input type="text" id="datepick"></p>  
    <script type="text/javascript">        
        $(function() {            
           $("#datepick").datepicker();           
        });
    </script>
4

1 回答 1

0

您也将段落 html 元素添加到元素中?如果是这样,请尝试将其移动到<body>标签内的某个位置,例如 views/index.ejs 文件。

于 2012-07-10T11:31:42.510 回答