It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Strings,, Broken Links, and Variables --HELP!

Strings,, Broken Links, and Variables --HELP!

Postby dannygoor on Fri Aug 14, 2009 12:03 am

Strings,, Broken Links, and Variables --HELP!

I have a page with over 600 lines of code that I need to fix,
the problem is as such:

The page contains about 200 links, the problem is that the link tags are all messed up,, instead of the URL's they all got replaced with xxxxx

so instead of: <a href="http://mystore.com/product1">product1</a>
it would read: <a href="http://mystore.com/xxxx">product1</a>

each product has to link to it's own page .... i.e:

product1 goes to /mystore.com/product1,,, and so on

I need help writing a script or performing some sort of function, that will take the text in between the <a></a> tags and insert it into it's own tag instead of the xxxxx

so it would see <a href="http://mystore.com/xxxx">BaseBall Gloves</a> and convert that line into <a href="http://mystore.com/BaseBall%20Gloves>BaseBall Gloves</a>

-- OUTPUTS: the ideal way would be if it could replace the existing source (kind of how you can do a find and replace),, if that's not possible, it would need to output all the existing source code with the modified <a> tags to a new window, and then I can copy that code into a new page.

I've tried using regular expressions and different functions but can't get it to work.

I really appreciate your help..

Thanks.
dannygoor
 
Posts: 1
Joined: Thu Aug 13, 2009 11:45 pm

Who is online

Users browsing this forum: No registered users and 2 guests