[英]TypeError: undefined is not an object (evaluating 'c.trigger')
I have loaded the jquery-ui-1.8.7.custom.min.js file in my javascript. 我已经在JavaScript中加载了jquery-ui-1.8.7.custom.min.js文件。
But when I run my code: 但是当我运行我的代码时:
<script>
$('.css').datepicker().datepicker(val);
</script>
I get an error like this in the console: 我在控制台中收到这样的错误:
TypeError: undefined is not an object (evaluating 'c.trigger') in jquery/jquery-ui-1.8.7.custom.min.js (line 491)
not sure, why this happening. 不知道为什么会这样。
Thanks in advance. 提前致谢。
Change it to: 更改为:
<script>
$('.css').not('.hasDatePicker').datepicker(val);
</script>
Try making your selector more specific. 尝试使选择器更具体。 Do you want to run
.datepicker()
on all alements that have class css
? 是否要在所有具有
css
类的元素上运行.datepicker()
?
EDITED: 编辑:
Hey, you need to load jQuery itself not only jQuery UI! 嘿,您不仅需要加载jQuery UI,还需要加载jQuery!
Make sure to embed it: 确保嵌入它:
<script src="//code.jquery.com/jquery-latest.min.js"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.