In a lot of time to check whether for the URL code, verify that the URL is the correct format Oh, the following provides a JS authentication URL function, he can verify the HTTPS tutorial |http|ftp|rtsp|mms, there are ports.
**
* Check whether the URL
*
* @param {}
* Str_url
* @return {Boolean} true: URL,false:<b> is not a </b> URL;
*/
This.isurl = function (Str_url) {//Validate URL
var Strregex = "^ (HTTPS|HTTP|FTP|RTSP|MMS)?:/ /)"
+ "? ([0-9a-z_!~* ' (). &=+$%-]+:)? [0-9a-z_!~* ' (). &=+$%-]+@)? " user@ of FTP
+ "([0-9]{1,3}.) {3} [0-9] {1,3} "//IP form of url-199.194.52.184
+ "|"//Allow IP and domain (domains)
+ "([0-9a-z_!~* ' ()-]+.) * "//Domain name-www."
+ "([0-9a-z][0-9a-z-]{0,61})?" [0-9a-z]. " Level two domain name
+ "[a-z]{2,6}]"///domain-. com or. Museum
+ "(: [0-9]{1,4})?"//Port-: 80
+ "((/?)|" A slash isn ' t required if there is no file name
+ "(/[0-9a-z_!~* ' ().;?: @&=+$,%#-]+) +/?" $";
var re = new RegExp (Strregex);
Return Re.test (Str_url);
}