jQuery对象不支持此属性或方法 [英] Jquery Object doesn't support this property or method
问题描述
我的JSP页面中包含以下内容,但出现错误
I have the following in my JSP page and I am getting error
Message: Object doesn't support this property or method
在$("#projects").dataTable({
如果我删除
.makeEditable({
sAddURL: "addController"
});
然后没有js错误,如何解决此问题?
then there are no js errors, how can I resolve this issue?
JS代码
$(document).ready(function () {
$("#projects").dataTable({ // error here
"bServerSide": true,
"sAjaxSource": "mycontroller",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true
}).makeEditable({
sAddURL: "addController"
});
});
我有以下js文件
<script src="scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="scripts/jquery.dataTables.editable.js" type="text/javascript">
</script>
<script src="scripts/jquery.jeditable.js" type="text/javascript"></script>
<script src="scripts/jquery.validate.js" type="text/javascript"></script>
<script src="scripts/jquery-ui.js" type="text/javascript"></script>
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/jquery.dataTables.min.js" type="text/javascript"></script>
推荐答案
@Guffa已经足够回答了.如果需要,您可以接受他的回答. :)
Well, @Guffa already answered sufficiently. You can accept his answer if you want. :)
我只想添加另一件事,那就是jQuery版本之间的冲突.这是因为,如果您使用的插件与jQuery版本不兼容,那么您会包括在内(有一段时间了).您可以添加与该插件兼容的另一个jQuery版本,以及使用 jQuery.noConflict()
I just want to add another thing, which is the conflict between jQuery versions. It's because if you use plugins that are not compatible with the jQuery version you've included (happened to me some time). You can add another jQuery version that is compatible with that plugin, along with using jQuery.noConflict()
这篇关于jQuery对象不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!