4 ms·
There's a native way to avoid that recursion. var snap = document.evaluate('//text()', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); for
by bazzargh 13y ago
There's a native way to avoid that recursion.
var snap = document.evaluate('//text()', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
for (var i=0;i<snap.snapshotLength;i++){t=snap.snapshotItem(i);t.textContent = replace(t.textContent);}
Also, the regexps would probably be better like /\belection\b/gi, to avoid eg reelection->reeating contest.
- JasonFruit 13y agoI think a reeating contest sounds . . . challenging.