JS验证URL

 function isURL() {
            var strRegex = "^((https|http|ftp|rtsp|mms)://)?[a-z0-9A-Z]{3}\.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z]\.com|net|cn|cc (:s[0-9]{1-4})?/$";
            var re = new RegExp(strRegex);
            if (re.test(document.getElementById("<%=txtServerIP.ClientID %>").value)) {
                alert("成功");
                return true;
            } else {
                alert("失败");
                 return false;
            }
        }

有问题请联系我:494960120  QQ

posted on 2010-08-16 15:50  ~~奔跑~~  阅读(9408)  评论(1编辑  收藏  举报

导航