I want to prepand http://
to every URL that doesn't begin with it, I used this:
if (val.search('http://') === -1) {
val = 'http://' + val;
}
The problem is that it appends http://
to URLs that begin with https//
I want to ignore both http://
and https://
.