Add domain to relative urls

Posted by Rick on Stack Overflow See other posts from Stack Overflow or by Rick
Published on 2010-04-11T17:06:00Z Indexed on 2010/04/11 17:23 UTC
Read the original article Hit count: 346

Filed under:
|

How can I add http://facebook.com to relative URL's contained within #facebook_urls? Eg:

<a href="/test.html">

becomes

<a href="http://facebook.com/test.html">

#facebook_urls also contains absolute urls, so I want to make sure I don't touch those.

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about search-and-replace