I need to validate a url in variable with jQuery, but can\'t use validate-plugin. Is there a simple way to do this?
var url = $('input.surl').val(); var url_validate = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; if(!url_validate.test(url)){ alert('error'); } else{ alert('success'); }