当前位置: 代码迷 >> JavaScript >> JS证验URL
  详细解决方案

JS证验URL

热度:106   发布时间:2012-11-23 00:03:43.0
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;
            }
        }
  相关解决方案