J
Jeremy
I have a script that runs a regular expression replace on all text in
the document. Currently, I recurse the entire document looking for text
nodes and run the replacement on the text nodes when I find them. The
problem is, this gets really slow for complicated documents.
Is there a better way to either:
a) Get a flat list of all the text nodes in the document (like
getElementsByTagName, only for text nodes)
b) Run a regex replace on only text in the document (not tags or their
attributes)?
Thanks,
Jeremy
the document. Currently, I recurse the entire document looking for text
nodes and run the replacement on the text nodes when I find them. The
problem is, this gets really slow for complicated documents.
Is there a better way to either:
a) Get a flat list of all the text nodes in the document (like
getElementsByTagName, only for text nodes)
b) Run a regex replace on only text in the document (not tags or their
attributes)?
Thanks,
Jeremy