jquery check valid link
$.validator.addMethod("UrlVal", function (value, element) {
var Inicio_URL = ['http://www', 'https://www', 'www', 'ftp://www'];
var Fim_URL = ['com', 'net', 'org', 'pt', 'eu','co'];
var Url_Inserido = value.toLowerCase().split(".");
if (Inicio_URL.includes(Url_Inserido[0])) {
if (Fim_URL.includes(Url_Inserido[(Url_Inserido.length - 1)])) {
return true;
} else
return false;
} else
return false;
})
var myURL;
function validURL(myURL) {
var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ //port
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
'(\\#[-a-z\\d_]*)?$','i');
return pattern.test(myURL);
}
document.write(validURL("http://qries.com"));
Also in JavaScript:
- jquery when you typing in input
- react hook form example stack overflow
- split a message
- hello
- biden trump javascript real time election
- how to add data modal target attribute in jquery
- javascript .tolowercase
- how to add bootstrap in angular
- lookup in mongodb array
- react import brackets
- Authentication handling in javascript
- angular serve
- compare two dates using moment
- JavaScript create UUID
- contact form7 404 wp-json feedback
- discord.js dm user
- react native length of object
- Javascript counting valleys
- react file input
- js match img
- chartjs how to disable animation
- js random number
- javascript subtract years from date
- nodejs express return image