In some versions of UEditor, If you paste the content in Excell to the editor, it will not be pasted in, open the console and find that JS reports an error.
In ueditor. all. js: 3048, the following error is reported:
Uncaught TypeMismatchError: Failed to execute 'removeattributenode 'on 'element': The node provided is invalid.
The cause of this error may be that the object that calls removeAttributeNode is null or the parameter passed into removeAttributeNode is null.
Go to this line of code to see:
RemoveAttributes: function (node, attrNames) {attrNames = utils. isArray (attrNames )? AttrNames: utils. trim (attrNames ). replace (/[] {2,}/g ,''). split (''); for (var I = 0, ci; ci = attrNames [I ++];) {ci = attrFix [ci] | ci; switch (ci) {case 'classname': node [ci] = ''; break; case 'style': node.style.css Text =''; // if (node. getAttributeNode ('style ')! = Null) {// Add this sentence // 3048! Browser. ie & node. removeAttributeNode (node. getAttributeNode ('style') //} node. removeAttribute (ci );}},
The cause of the error is that row 3048 node. getAttributeNode ('style') returns null and passes in removeAttributeNode. The solution is to add node. getAttributeNode ('style') to the null judgment, as shown in the code above.