Jquery - Removing Empty Text Nodes IE

I have a problem with IE where I have "Empty text nodes" loaded in my tr . If I run

 $('#myTr').children().length 

and

 $('#myTr').find('td').length 

I get the same value, which means that these nodes are not registered in jquery. Selector :empty returns without anything.

In addition, if I remove these nodes manually from the IE debugger, the format changes, so something happens there.

Here is what I see in the IE debugger (IE 8, btw):

enter image description here

Any ideas? It makes us nuts ..

+4
source share
2 answers

HTML is agnostic in the form of spaces, so it doesn't matter that there are empty text nodes. I suspect that you have a slightly different problem that can be solved by deleting text nodes.

For example, manually deleting text nodes can result in a re-planning or redrawing of a document that corrects a rendering error. Or maybe messing with the nodes in the hasLayout debugger triggers in the parent (assumption).

+1
source

Source: https://habr.com/ru/post/1487142/


All Articles