This article provides a perfect JS verify URL is correct code, he can verify all domain names, such as Cc,hk,me,pro, such as URL regular validation expression function.
function Isvalidurl (chars) {
chars = Chars.replace (', ', "");
var re=/^ ([hh][tt]{2}[pp]://|[ hh][tt]{2}[pp][ss]://) (((w+ (-*w*) +).) + ((COM) | (NET) | (edu) | (gov) | (org) | (Biz) | (Aero) | (COOP) | (info) | (name) | (PRO) | (museum)) (. ([a-z]{2})?) | ((w+ (-*w*) +). (CN))) $/;
var re=/^ ([hh][tt]{2}[pp]://|[ hh][tt]{2}[pp][ss]://) (s+.s+) $/;
var re=/^ ([hh][tt]{2}[pp]://|[ hh][tt]{2}[pp][ss]://) ((((w+ (-*w*) +).) + ((COM) | (NET) | (edu) | (gov) | (org) | (Biz) | (Aero) | (COOP) | (info) | (name) | (PRO) | (Me) | (cc) | (Museum) | (CN) | (TV) | (HK)) (. ([a-z]{2})?) | ((w+ (-*w*) +). (CN))) ((/|?) s*) *) $/;
if (!isnull (chars)) {
chars = Jstrim (chars);
if (Chars.match (RE) = null)
return false;
Else
return true;
}
return false;
}