I’m trying to set up a function to process all text nodes within the <body> in two passes:
[CODE]function trv(q,p1){
if(p1){
$(“body *”).contents().each(function() {
if(this.nodeType == 3) {
if(this.data.indexOf(‘!’)!=-1) this.data=”;
}
});
} else {
$(“body *”).contents().each(function() {
if(this.nodeType == 3) { alert(this.data);
if(this.data==”) {
}
}
});
}
}
The strange thing is, that if I place the alert within:
[CODE] if(this.data==”) {
}
…it doesn’t work (on all browsers I’ve tested)
You can see it working here:
[url]http://4nf.org/
Any ideas why?
Here’s a deep link to the complete respective .js:
[url]http://4nf.org/n.js
Thanks in advance and kind regards