Results 1 to 2 of 2

Thread: Javascript to search and replace HREF=

  1. #1
    Join Date
    Oct 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript to search and replace HREF=

    All,

    Is there a way to use Javascript to search and replace all link in the body with a new value? My search engine generates links with Mapped drive which causes problems with Firefox and Netscape (works fine with IE).

    For example, on each of the search result, the link HREF="C:\Test\test\test.html" should be replaced with HREF="http://www.abc.com/test/test.html" ???.

    Since these search result are dynamic, maybe I could use Onload on the body and searc&replace all of the HREF="C:\Test\test\ with HREF="http://www.abc.com/test All links start with HREF="C:\Test\test\

    Is this possible? If it is, sample code, please.

    Thank you.

    Chris

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There isn't a way that I know of to do this, as I don't think Javascript has the capability to parse HTML.

    Use notepad on your HTML file to replace c:\test\test with www.yourhost.com/ if need be. Which HTML generator are you using?

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •