How can I remove duplicate forward slashes from the a url, but keep the // which comes after http: so that the URL does not break.
http:
http://localh
This question has been answered before...
var str = 'http://localhost//example/author/admin///'; var clean_url = str.replace(/([^:])(\/\/+)/g, '$1/'); alert(clean_url);