Forum Moderators: open

Message Too Old, No Replies

HREF swapping in JS

         

lokeshshettyk

4:18 pm on Aug 20, 2009 (gmt 0)

10+ Year Member



Hi everyone,
I am looking for JS script to replace find all the href values on a page and replace those href values matching them with an array of values.

my array, lets say is a = {'some.ex.com', 'abc.ex.com/tv', 'some.name.ex.com', 'bcd.ex.com/dir1/dir2/some.jsp' }; etc

i want to find all the URLs on a given page, check if each found url matches with any of the values in the array, if match found, just replace only "ex.com" with "example.com" for every match.

I am all new to JS and please please help

lokeshshettyk

4:12 pm on Aug 22, 2009 (gmt 0)

10+ Year Member



Thanks to all the viewers. I finally wrote my own script as per my need.

whoisgregg

7:15 pm on Aug 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad you got it sorted, lokeshshettyk. :)

Would you be interested in posting your solution? If others run into the same problem, your experience could be very helpful.