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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -