var pattern = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if (pattern.test(url)) {
content+='<a href="'+value.v_url+'" target="_blank">'; // Url is valid
}
else{
console.log("invalid url");
}
No comments:
Post a Comment