日期选择器不是功能 [英] datepicker is not a function

查看:67
本文介绍了日期选择器不是功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题已经被问过很多遍了,但是没有一个对我有用.我试图在JSP文件中使用此日期选择器.这是我的剧本

This question is already asked many times but none of them worked for me. I am trying to use this date picker in a JSP file. This is my script

<head>
<title>My Home</title>
<link rel="stylesheet" type="text/css"
href="../resource/css/page-style.css" />
<link rel="stylesheet" type="text/css"
href="../resource/css/jQuery-ui.css" />
<script src="../resource/js/jquery-1.9.1.js"></script>
<script src="../resource/js/jquery-ui.js"></script>
<script type="text/javascript" src="../resource/js/form-elements.js"></script>

<script type="text/javascript">
$("document").ready(function() {
    $("#shortcuts").load("shortcut.html");
    $("#datepicker").datepicker();
    alert('jQuery is working');
});
</script>
</head>

shortcut文件完美加载,警报也显示.我收到错误消息为TypeError: $(...).datepicker is not a function.如果我在桌面上放置的html文件中运行此脚本,就不会遇到此问题,当我将come代码复制到IDE中并运行它时,我会在控制台中收到此错误.请建议我该怎么办?我知道这个问题已经问过好几次了,我已经检查了每个答案,这是唯一的 link 与我的概率非常匹配,但对我不起作用.

The shortcut file is loading perfectly, alert is also showing. I get error message as TypeError: $(...).datepicker is not a function. I am not facing this problem if I run this script in a html file placed in my desktop, when I copy the come code to my IDE and run it I get this error in my console. Please suggest me what can I do? I know this question is asked several times I have checked every answer this is the only link having close match to my prob but didn't work for me.

推荐答案

问题与您导入的文件有关.我认为您没有正确放置它们.

The problem is with your imported files.I think you have not placed them properly.

尝试导入这些文件

 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

它为我工作.

更多信息请参见此处信息

这篇关于日期选择器不是功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆