Is it possible to create a new Location object in javascript? I have a url as a string and I would like to leverage what javascript already provides to gain access to the di
You can leverage the power of an anchor element
var aLink = document.createElement("a"); aLink.href="http://www.example.com/foo/bar.html?q=123#asdf"; alert(aLink.pathname);