[...]
'es' is just the language it should switch to - spanish in this
example:
function gethtml(lang){
var url = window.location.href;
url = url.replace("
http://quaaoutlodge.com/","
http://quaaoutlodge.com/
lang/"+lang+"/");
return url;
}
People seem to have had difficulties in understanding what you're doing,
but having seen situations where such operations may make sense, I'm
taking a guess: You have a page with local (relative) links, and you
would like to rewrite some of those links so that they are replaced by
absolute links with a part that selects a particular language. The
specifics still aren't clear at all (a real URL would have helped a lot,
as usual), and I doubt whether this is one of the rare cases where the
approach makes sense, but...
....you need some way of selecting the link(s) to be changed, and then
you just do something like
foo.href = gethtml('es') + foo.href
where foo is a variable referring to an element.
Oh wait... you have written "xyz.com", which _is_ a relative link, but
maybe you actually meant "
http://xyz.com", referring to an external
site. Then I don't see why your gethtml() takes the _current_ page URL
(window.location.href) as the starting point.