未捕获类型错误:未定义是不是在日期选择器功能 [英] Uncaught TypeError: undefined is not a function in datepicker
问题描述
我试图使用jQuery的日期选择器中mvc4。
I am trying to use date picker of jquery in mvc4.
这是给我的错误:
Uncaught TypeError: undefined is not a function
我的jQuery的功能是这样的:
My jQuery function is like:
$(document).ready(function () {
$('#dpFrom').datepicker();
});
HTML部分是这样的:
html part is like:
<input type="text" id="dpFrom" />
我所指向:
<一个href=\"http://stackoverflow.com/questions/23232897/uncaught-typeerror-undefined-is-not-a-function-while-using-jquery-ui?answertab=active#tab-top\">Uncaught类型错误:未定义是不是在使用功能jQuery UI的
和包括:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
所以总的JavaScript变成了:
So total javascript became:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#dpFrom').datepicker();
});
</script>
不过它给我的错误。
Still its giving me error.
请帮忙...
推荐答案
我觉得你有一个重复的jQuery的参考。你能在你的网页浏览器中打开查看源文件,并列举你的jQuery的参考?这是一个常见的错误,容易漏诊。也许一个包定义或您的布局和内容的网页具有相同的参考。
I think that you have a duplicate jQuery reference. Could you open a "View Source" on your web browser and enumerate your jQuery references? It is a common error and easily missed. Maybe a bundle definition or your layout and content pages have the same reference.
这篇关于未捕获类型错误:未定义是不是在日期选择器功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!