JavaScript : How do I parse a URL into hostname and path in javascript?

Published --