zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    hdu1066之数学题
    hdu1065计算几何
    hdu1060
    hdu1056
    appium安装说明
    LR安装说明
    网络编程
    读写excel
    dom
    HTML
  • 原文地址:https://www.cnblogs.com/FeiyueHang/p/1800782.html
Copyright © 2011-2022 走看看