Fix internal links in JS

Posted by FB55 on Stack Overflow See other posts from Stack Overflow or by FB55
Published on 2010-05-30T11:26:49Z Indexed on 2010/05/30 11:32 UTC
Read the original article Hit count: 231

Filed under:
|
|
|

I just created a script which extracts the article out of a webpage via server-side JS. (If your interested: it's used for http://pipes.yahoo.com/fb55/expandr .)

I just got a little problem with internal links. Some pages include links like:

/subfolder/subpage.html

What I would need to do is fixing them and setting there root, like this:

protocol://secondlevel.firstlevel/subfolder/subpage.html

I'm using E4X for processing the page. I don't want to show my current creepy try, it's buggy and slow. Does anybody have a solution for me?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about link