var Utils = {
isUrl : function(str_url) {
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);
//re.test()
if (re.test(str_url)) {
return true;
} else {
return false;
}
}
};
JS校验url地址
最新推荐文章于 2024-07-21 23:04:09 发布