Simply prepend http://
if it's not there and then test.
if (inputURL.substring(0,7) != 'http://' && inputURL.substring(0,8) != 'https://') {
inputURL = 'http://' + inputURL;
}
No large libraries required or anything, just a few lines of code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…