JavaScript is not the place to be doing this. What's the point of rewriting meta data about the document after you've already started serving the document? For one thing, those without JavaScript will end up getting different meta data (think about search engines). But even more importantly, if you've got home.example.com serving the same content (or nearly the same, if you take meta data into account), as example.com, then (as lucy24 pointed out) you're going to dilute the value of your content in the eyes of search engines.
Dijkgraaf
12:53 am on Jul 24, 2012 (gmt 0)
Which is why my original question to him was "What scripting language is available on the web server." Client site scripting is not a good solution as Fotiman's pointing out.