Javascript – How to replace text using JavaScript


There is large website all data comes from database ,

I want to remove all instances of "(MHC)" from next to company name on this page, and also more than 12 other pages.

like "Northfield Bancorp Inc. (MHC)" to "Northfield Bancorp Inc."

Is there any JavaScript for this? I have tried xslt solution, but still prefer a JavaScript solution.

Best Solution

First of all, I'd just change the database entry...

Furthermore, you should be doing this removal on the server side. For example, you can use PHP to reformat the data before outputting it to the user. Simply use PHP to make the database query, store it in a PHP variable, and then parse the string appropriately.