Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null. jquery.tools.min.js:38
f.extend.clean jquery.tools.min.js:38
f.buildFragment jquery.tools.min.js:38
f.fn.extend.domManip jquery.tools.min.js:38
f.fn.extend.append jquery.tools.min.js:37
_fnFeatureHtmlLength jquery.dataTables.js:3209
_fnAddOptionsHtml jquery.dataTables.js:2099
_fnInitialise jquery.dataTables.js:3083
(anonymous function) jquery.dataTables.js:6301
e.extend.each jquery.tools.min.js:36
e.fn.e.each jquery.tools.min.js:36
DataTable jquery.dataTables.js:5838
(anonymous function) index.php?r=rfp:148
n jquery.tools.min.js:36
o.fireWith jquery.tools.min.js:36
e.extend.ready jquery.tools.min.js:36
c.addEventListener.B jquery.tools.min.js:36
一个问题是我将getElementbyId用于不在页面上但在其他位置的onclick函数(执行ajax调用)。这可能是导致错误的原因。我想知道如何保持该状态并以某种方式解决此错误?
编辑:下面添加了一个示例行的示例代码(有很多)
<table id="main_table" class="dataTable no-footer">
<thead>
<tr>
<td>Stuff</td>
<td>More Stuff</td>
<td>Even more stuff</td>
</tr>
</thead>
<tbody>
<tr role="row">
<td onclick="document.getElementById("cdid").value=232; document.getElementById("viewForm").submit();"> ... </td>
<td> more things </td>
<td> even more things </td>
</tr>
...
More rows of the same format
</tbody>
</table>
我在jQuery dataTables中遇到了类似的问题。我通过更改jQuery版本以某种方式解决了它。以前,我使用的是1.6.4版的jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
但是,后来,我将其更改为最新版本jquery-1.11.0
<script src="//code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>
错误消失了,我可以看到我的桌子。请检查您使用的jQuery版本,并将其更改为最新版本。如果您遇到和我一样的问题,此解决方案将有所帮助。
还要确保,如果您使用的是jquery.tools.js,请确保dataTables需要使用jquery.js而不是jquery.tools.js,然后将其更改为jquery.js(最新版本)并查看其是否有效。
希望对您有所帮助,谢谢。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句