joining relative urls?
- by heffaklump
So i want to join strings with relative urls in Javascript.
base url = "http://www.adress.com/more/evenmore"
with
relative url = "../../adress" = "http://www.adress.com/adress"
relative url = "../adress" = "http://www.adress.com/more/adress"
What would be the best way? I was thinking of using regexp and checking
how many "../" i find, then subtracting that amount from the baseurl and adding them to what is left.