Commit 88045eca authored by chicheng's avatar chicheng

验证URL格式(支持 localhost、IP、域名)

parent 307119d1
......@@ -13,10 +13,10 @@ function mobile(value) {
}
/**
* 验证URL格式
* 验证URL格式(支持 localhost、IP、域名)
*/
function url(value) {
return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value)
return /^http(s)?:\/\/([^\/\s]+)(\/[^\s]*)?$/.test(value)
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment