1) Script Title: gAjax RSS Feeds Displayer (hosted)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sdisplayer.htm
3) Describe problem: How to remove specific word(fwords) from description?
1) Script Title: gAjax RSS Feeds Displayer (hosted)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sdisplayer.htm
3) Describe problem: How to remove specific word(fwords) from description?
In the gfeedfetcher.js file, this line places the text to be displayed in the feed catcher on your page:
If it's just one word you are concerned with, do:Code:this.feedcontainer.innerHTML=rssoutput
If you have a bunch of words in mind, make up a variable:Code:this.feedcontainer.innerHTML=rssoutput.replace(/badword/gm, '****');
Place it at the top of the gfeedfetcher.js file as shown.Code:// ------------------------------------------------------------------- // gAjax RSS Feeds Displayer- By Dynamic Drive, available at: http://www.dynamicdrive.com // Created: July 17th, 2007 Updated: n/a // -------------------------------------------------------------------var badwords = new RegExp('(badword1)|(badword2)|(badword3)|(badword4)', 'gm');var gfeedfetcher_loading_image="indicator.gif" //Full URL to "loading" image. No need to config after this line!!
Then make that other line we were talking about look like so:
Just make sure none of your bad words could legitimately be contained inside of other words especially HTML markup. If you have such a word in mind, we can deal with it easily enough, though I can't think of any 'bad' words off of the top of my head that would qualify for special treatment in that regard.Code:this.feedcontainer.innerHTML=rssoutput.replace(badwords, '****');
Last edited by jscheuer1; 03-05-2009 at 05:42 PM. Reason: spelling
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
z2z (03-05-2009)
thanks jscheuer1![]()
It just occurred to me, that sometimes a bad word might be capitalized, even perhaps in violation of the general rules of capitalizing words, so we should use the i (case insensitive) switch as well. If doing a single word:
If using the variable RegExp constructor:Code:this.feedcontainer.innerHTML=rssoutput.replace(/badword/gmi, '****');
Code:var badwords = new RegExp('(badword1)|(badword2)|(badword3)|(badword4)', 'gmi');
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
z2z (03-13-2009)
thanks mate
Is possible to add http://www.dynamicdrive.com/dynamici...edcollapse.htm
like example 4 - 5 -6
Bookmarks