Hi ..
I have an adea to replace some charactor by another one in web pages by JavaScript.
Example(1) - One Charactor Replacing :
----------------------------------------------------------------
I need to replace:
any "#" charactor to "@"
any "a" to "A",
any "\n" to " ",
and any "~" to "&".
Example(2) - Word or Phrase Replacing :
----------------------------------------------------------------
Replacing a list or array of bad words to other words.
I don't know how I can do that for all document items like: <body>, <td>, <th>, <div>, <span>, <p> and so on.
but I need to check a full HTML page not only those tags.
Also I need a cross-browser code using DOM.
I think we can use something like this:
Code:
item.innerHTML
or:
document.layers.innerHTML // for Geko engine browsers.
document.all.innerHTML // for IE browser.
I can do this simply in PHP language functions like
str_replace() but it's a server-side language, I want a cleint-side method by JavaScript.
Can any JavaScript professional help me ?