naeemqaswar
11/29/2018 - 8:05 PM

Add Protocol if not exist

function addhttp(url) {
    if (!/^(?:f|ht)tps?\:\/\//.test(url)) {
        url = "http://" + url;
    }
    return url;
}