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

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

c# - Global Variables vs. ASP.NET Session State -