背景:我正在尝试通过CMS编辑页面,该页面是使用jquery和css大量定制的。但是,在不熟悉HTML的员工的管理中心中,他们可以使用称为WYSIWYG的此工具,该工具基本上是一个富文本编辑器,他们可以进入并进行事件信息的任何更新,添加图像,嵌入视频等。< / p>
问题:编辑按钮不起作用-我的猜测是,我从引导程序使用的任何新JS代码都会影响该代码,因为该编辑功能开箱即用。
单击编辑按钮时,我收到一条消息:
窗口window_1559613391177已在DOM中注册!使 确保您使用setDestroyOnClose()或destroyOnClose:在 构造函数
在带有上述消息的警报窗口中单击“确定”后,在控制台中,我看到以下内容:
prototype.js:86 Uncaught TypeError: Failed to execute 'evaluate' on 'Document': parameter 2 is not of type 'Node'.
at HTMLDocument.document._getElementsByXPath (prototype.js:86)
at HTMLDocument.document.getElementsByClassName (prototype.js:88)
at getElementsByClassName (prototype.js:99)
at HTMLDivElement.<computed> [as getElementsByClassName] (prototype.js:95)
at tiny_mce_src.js:4454
at tiny_mce_src.js:4473
at tiny_mce_src.js:4581
document._getElementsByXPath @ prototype.js:86
document.getElementsByClassName @ prototype.js:88
getElementsByClassName @ prototype.js:99
<computed> @ prototype.js:95
(anonymous) @ tiny_mce_src.js:4454
(anonymous) @ tiny_mce_src.js:4473
(anonymous) @ tiny_mce_src.js:4581
据我所知,prototype.js第86、88和99行是:
//86
if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(query.snapshotItem(i)); return results; }; } document.getElementsByClassName = function(className, parentElement) {
if (Prototype.BrowserFeatures.XPath) { var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; return document._getElementsByXPath(q, parentElement); } else {
var children = ($(parentElement) || document.body).getElementsByTagName(' *');
var elements = [],
child;
for (var i = 0, length = children.length; i < length; i++) { child = children[i]; if (Element.hasClassName(child, className)) elements.push(Element.extend(child)); }
return elements;
}
};
//88
document.getElementsByClassName = function(className, parentElement) {
if (Prototype.BrowserFeatures.XPath) { var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; return document._getElementsByXPath(q, parentElement); } else {
var children = ($(parentElement) || document.body).getElementsByTagName('*');
var elements = [],
child;
for (var i = 0, length = children.length; i < length; i++) {
child = children[i];
if (Element.hasClassName(child, className))
//99
up: function(element, expression, index) { return Selector.findElement($(element).ancestors(), expression, index); }, down: function(element, expression, index) { return Selector.findElement($(element).descendants(), expression, index); }, previous: function(element, expression, index) { return Selector.findElement($(element).previousSiblings(), expression, index); }, next: function(element, expression, index) { return Selector.findElement($(element).nextSiblings(), expression, index); }, getElementsBySelector: function() { var args = $A(arguments),
element = $(args.shift()); return Selector.findChildElements(element, args); }, getElementsByClassName: function(element, className) { return document.getElementsByClassName(className, element); }, readAttribute: function(element, name) {
element = $(element);
if (document.all && !window.opera) { var t = Element._attributeTranslations; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; var attribute = element.attributes[name]; if (attribute) return attribute.nodeValue; }
任何帮助,指导和建议,我们将不胜感激!
感谢您的时间!