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.
-
Sounds like someone is trying to rip off a corporate website design...Brian Ramsay– Brian Ramsay2009年06月18日 14:47:33 +00:00Commented Jun 18, 2009 at 14:47
-
No Dear, I am working for that website. and got update from that Client, ThanksWasim Shaikh– Wasim Shaikh2009年06月18日 14:51:30 +00:00Commented Jun 18, 2009 at 14:51
-
1Do this in client side JavaScript would be a very poor idea. The old data would still appear to users without JS, in search engine results, in browsers with JS while the page is being built, and so on.Quentin– Quentin2009年06月18日 15:08:58 +00:00Commented Jun 18, 2009 at 15:08
-
Yes , you are right. Still thinking for that.Wasim Shaikh– Wasim Shaikh2009年06月18日 15:59:51 +00:00Commented Jun 18, 2009 at 15:59
3 Answers 3
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.
1 Comment
Just do a replace:
var data = "Northfield Bancorp Inc. (MHC)";
var newData = data.replace(" (MHC)", "", "ig");
2 Comments
You can use javascript regular expressions to parse your text