Using javascript/jquery, validate URL that should have http or https and www -


please advice how validate url should have http or https , www in it

thanks amit

try use function:

(function isurl(s) {     var regexp = /http(s?):\/\/www\.[a-za-z0-9\.-]{3,}\.[a-za-z]{3}/;      return regexp.test(s); })("https://www.google.com") 

you may play here


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

ASP.NET Javascript: window.open won't work twice -

jquery - Opera does not change the height of the page. Why? -