I view a forum were links are not allowed so everyone posts the text of the link (ex
http://google.com) instead of
google so I attempted to fix it.
However my script ends up with "%gt" (the great than symbol) instead of "<" what should I do?
alert('Works at the top');
textnodes = document.evaluate(
"//text()",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (var i = 0; i < textnodes.snapshotLength; i++) {
node = textnodes.snapshotItem(i);
if ( node.data.indexOf('imageshack.us') > 0 ) {
s = node.data;
s = s.link(s);
// alert(s);
node.data = s;
}
}