I'm filtering the entire DOM to replace some strings with other strings.
For this I wrote the following code:
$('body :not(script)').contents().filter(function() {
return this.nodeType === 3;
}).replaceWith(function() {
return this.nodeValue.replace('T 0','T 0');
});
How can I exclude some areas? For example I want the DIV with the class .example not to be considered.
I tried the following:
$('body :not(script):not(.example)').contents().filter(function() {
return this.nodeType === 3;
}).replaceWith(function() {
return this.nodeValue.replace('T 0','T 0');
});
Why does this not seem to work?