【发布时间】:2014-09-23 18:15:24
【问题描述】:
为什么这段代码不再有效?这是从 jquery ui 示例页面复制和粘贴的。以前可以正常工作,现在不行了。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
【问题讨论】:
-
对我有用,除了样式(出于显而易见的原因..)什么不适合你?另外,您是否看到任何控制台错误?请注意,
//不适用于file:///协议。您需要明确使用http://或https:// -
定义不起作用。
-
jsfiddle.net/bozrxa30/1 工作得很好
标签: jquery jquery-ui jquery-ui-datepicker