UEditor pasted the table in Excell, and an error was reported.

Source: Internet
Author: User

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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.