J
Jane Doe
Hi,
I need to search and replace patterns in web pages, but I
can't find a way even after reading the ad hoc chapter in New Rider's
"Inside JavaScript".
Here's what I want to do:
function filter() {
var items = new Array("John", "Jane");
for (x = 0; x < items.length; x++) {
//Doesn't work
pattern = '/' + items[x] + '/';
//Doesn't work either
document.body = document.body.replace(pattern,"IGNORED");
}
ie., create an array of items to look for in the BODY section of the
page, and if any item exists, replace the item with IGNORED.
Anyone knows how to do this?
Thank you
JD.
I need to search and replace patterns in web pages, but I
can't find a way even after reading the ad hoc chapter in New Rider's
"Inside JavaScript".
Here's what I want to do:
function filter() {
var items = new Array("John", "Jane");
for (x = 0; x < items.length; x++) {
//Doesn't work
pattern = '/' + items[x] + '/';
//Doesn't work either
document.body = document.body.replace(pattern,"IGNORED");
}
ie., create an array of items to look for in the BODY section of the
page, and if any item exists, replace the item with IGNORED.
Anyone knows how to do this?
Thank you
JD.