jQuery DatePicker 未加载
我有一段 jQuery 由于某种原因根本无法加载。我想知道这是否是我的语法错误,或者我是否遗漏了一些对其工作至关重要的东西。这被放置在包含的页面上。
<script>
jQuery(function() {
jQuery( "#datepicker" ).datepicker();
});
</script>
<div class="demo">
<p>Date: <input type="text" id="datepicker"></p>
<?php echo "hello world againagain!"; ?>
</div>
这是在index.php的标头中: /css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
<script src="<?php echo $intranetName; ?>/js/jquery_1_6.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo $intranetName; ?>/js/jquery-ui- 1.8.16.custom.min.js"></script>
IntranetName 加载脚本的域。它会加载脚本并在 html 源中显示正确的路径所以我不认为这是问题。但是,我仍然是 jQuery 的新手,谢谢!
我明白了,谢谢大家!
I have a piece of jQuery that will not load at all for some reason. I am wondering if it is an error in my syntax or if I am missing something crucial for it to work. This is placed on a page that is included.
<script>
jQuery(function() {
jQuery( "#datepicker" ).datepicker();
});
</script>
<div class="demo">
<p>Date: <input type="text" id="datepicker"></p>
<?php echo "hello world againagain!"; ?>
</div>
This is in the header of index.php:
/css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="Stylesheet" />
<script src="<?php echo $intranetName; ?>/js/jquery_1_6.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo $intranetName; ?>/js/jquery-ui- 1.8.16.custom.min.js"></script>
The intranetName loads the domain of the scripts. It does load the scripts and shows the correct path in the html source so I do not think that is the issue. However, I am still a novice to jQuery. Help please! Thanks.
I figured it out. It was due to my copy of jQuery being corrupted. Thank you everyone!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在
JQuery-UI
之前包含JQuery
编辑:
这在我的本地计算机上运行良好(即显示没有 css 的日期选择器):
所以它一定是您的 UI 包的问题。
Include
JQuery
beforeJQuery-UI
EDIT:
This is working fine on my local machine (i.e. showing datepicker without css):
So it must be a problem with your UI package.
您使用的是自定义版本的 jQuery (1.8.16.custom.min.js)。
确保您在 JavaScript 文件的自定义版本中包含 Datepicker 小部件。
请记住,Datepicker 位于 Widget 组内:http://jqueryui .com/download
You're using a customized version of jQuery (1.8.16.custom.min.js).
Make sure you're including the Datepicker widget in your customized version of the JavaScript file.
Keep in mind that Datepicker is inside Widget group: http://jqueryui.com/download