Prefix http:// to url

From Code Trash
Jump to: navigation, search
function prefixHttp(ref)
{
	if(!(ref = document.getElementById(ref)))return;
	if( (ref.value.indexOf('http://')+1 !=1) && (ref.value.indexOf('https://')+1 !=1) )
	{
//		if(confirm('No http:// prefix in url\n\nClick OK to add or Cancel to continue'))
		ref.value = 'http://'+ref.value
	}
}