- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个无法自己解决的问题。我调试了几天,但没有成功找到问题所在。
我有一个 chosen.js + jscrollpane.js。当一个选项打开时,搜索输入字段必须被聚焦以写入一些搜索字符串。我第一次打开所选内容时会引发错误,我无法在其中搜索任何内容。但是,如果我关闭所选择的并重新打开它,一切正常。
我为你制作了一个 fiddle : http://jsfiddle.net/y2h3ohr3/2/
所以当我第一次打开所选的错误时,我可以在 Chrome 的控制台中看到这个错误(在 firefox 中,错误存在但控制台不会抛出错误):
Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it was moved in a 'blur' event handler?
控制台抛出的痕迹:
jQuery.extend.buildFragment @ jquery-1.9.1.js:6541
jQuery.fn.extend.domManip @ jquery-1.9.1.js:6129
jQuery.fn.extend.append @ jquery-1.9.1.js:5949
initialise @ jquery.jscrollpane.min.js:115
JScrollPane @ jquery.jscrollpane.min.js:1388
(anonymous function) @ jquery.jscrollpane.min.js:1407
jQuery.extend.each @ jquery-1.9.1.js:648
jQuery.fn.jQuery.each @ jquery-1.9.1.js:270
$.fn.jScrollPane @ jquery.jscrollpane.min.js:1399
(anonymous function) @ chosen.jquery.js:774
jQuery.event.dispatch @ jquery-1.9.1.js:3074
elemData.handle @ jquery-1.9.1.js:2750
jQuery.event.special.focus.trigger @ jquery-1.9.1.js:3256
jQuery.event.trigger @ jquery-1.9.1.js:2952
(anonymous function) @ jquery-1.9.1.js:3677
jQuery.extend.each @ jquery-1.9.1.js:648
jQuery.fn.jQuery.each @ jquery-1.9.1.js:270
jQuery.fn.extend.trigger @ jquery-1.9.1.js:3676
jQuery.fn.(anonymous function) @ jquery-1.9.1.js:7403
$.fn.extend.focus @ jquery-ui.js:230
Chosen.results_show @ chosen.jquery.js:968
Chosen.container_mousedown @ chosen.jquery.js:839
(anonymous function) @ chosen.jquery.js:654
jQuery.event.dispatch @ jquery-1.9.1.js:3074
elemData.handle @ jquery-1.9.1.js:2750
我做了一个 fiddle ,它的设计与我的项目中的设计不一样,但错误重现完美(第一次打开时注意 chrome 控制台)。
你可以在这里查看 fiddle :
http://jsfiddle.net/y2h3ohr3/2/
谁能帮帮我?我被卡住了,我不能做更多,因为我没有在任何地方发现错误。错误是由 jquery 抛出的,而不是选择的,所以我没有制作自定义 appendChild
。
最佳答案
发生这种情况是因为在您的 fiddle 的第 115 行:
pane = $('<div class="jspPane" />').css('padding', originalPadding).append(elem.children());
您尝试将 elem.children() 附加到您的 Pane ,但是当您在您的选择中选择某些内容时,您的 elem 会发生变化。所以 jQuery 试图删除和添加一个不再存在的子项。一个快速的解决方案是克隆 elem.children,将它们存储在一个 var 中并附加克隆的 child 。像这样:
var $children = elem.children().clone();
pane = $('<div class="jspPane" />').css('padding', originalPadding).append($children);
关于javascript - jQuery 选择 : Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node' :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33566288/
我正在尝试使用python从elastisearch索引中检索文档。其代码如下: def get_data_es(): ES_HOST = { "host": "loc
我想在 Python 中使用 ElasticSearch 从给定的 URL(带有前缀)获取数据。这是我的代码: if __name__ == '__main__': username = "x
我现在很困惑,因为我通过添加“from mechanize import ControlNotFoundError”修复了一个错误。但是,它现在弹出此错误。任何帮助是极大的赞赏。我几天前才开始学习 p
我已经训练 TensorFlow 模型大约一周时间,偶尔进行微调。 今天,当我尝试微调模型时,出现错误: tensorflow.python.framework.errors_impl.NotFoun
代码: import pandas as pd import quandl quandl.ApiConfig.api_key = 'wsnt2aKcnkNMJjdqqwTz' pd = quandl.
我在请求范围内设置了一个employeebean resultEmployeeList 的数组列表。我不知道我是否以正确的方式这样做..但这里是jsp中使用的jSTL代码..
我正在尝试实现 D3 的动态功能,为此我遵循了 http://mbostock.github.io/d3/tutorial/bar-2.html 中给出的示例它工作正常,但是当我为 x 轴和 y 轴添
我在适用于 Linux 的 Windows 子系统的 Ubuntu 16.04 版本中使用 Tensorflow 1.14.0(通过 pip 安装)和 Python 2.7。我正在运行另一个人编写的脚
我正在尝试复制在时间序列中使用 RNN 的示例,如发布的 https://www.tensorflow.org/beta/tutorials/text/time_series#multi-step_m
当我使用以下方法恢复保存的模型时: checkpoint = tf.train.get_checkpoint_state(config.pre_model_dir) if checkpoint and
我在使removeChild()工作时遇到问题。我收到“NotFoundError:未找到节点 image_div.parentNode.removeChild(img);”错误 这是我的代码:
我正在 HTML5 中进行拖放操作,但是当我 dorp 我的项目时,我遇到了 Uncaught Error: NotFoundError: DOM Exception 8 任何人都可以帮助我。请检查下
我刚刚安装了基于 tf.__version__ = 1.14 的新环境。 以下是我配置张量板的方式: tensorboard = \ tf.keras.callbacks.TensorBoar
我使用以下代码使用 tensorflow 创建自定义初始。 import tensorflow as tf import sys interesting_class = sys.argv[1:] pr
我想我会喜欢并在 jQuery 事件期间使用普通 JavaScript。这个想法是,在单击标题时,我想向上滑动一个 div (可以工作)并将单击的标签替换为更大的标题。 根据我所读到的内容,这可能是由
收到此错误: # rails c FFI::NotFoundError: Function 'xmlRelaxNGSetParserStructuredErrors' not found in [li
问题:将 numpy 链接到正确的线性代数库。过程非常复杂,我可能会第六次寻找解决方案,但我不知道出了什么问题。我在 Ubuntu 12.04.5 上。 我重新安装了 blas 和 lapack,然后
我有一个 div里面另外三个div s 附加如下。状态值是通过循环来自 componentWillReceiveProps() 的 api 的结果来设置的。 .但我面临一个错误问题 Uncaught
无法真正描述为什么这不起作用。 我确实有 JS 对象控制一些数据,每个控件也有一个 HTML 对象。该对象存储在数组中。我在很多项目中都这样做过几次,但现在在使用 jQuery 的“wrapAll”时
我正在使用 retrain.py 在我的手部照片上重新训练对象检测器(以检测我握着多少根手指)。在 Tensorflow 网站上,我按照教程在花朵图像上对其进行了重新训练。所以我写了 python r
我是一名优秀的程序员,十分优秀!