JavaScript : How to extract base URL from a string in JavaScript?

Published --