I need to validate a url in variable with jQuery, but can\'t use validate-plugin. Is there a simple way to do this?
you Want to validate your URL:
Please pass the URL in this function then this will give you true OR false.
See Function :
<script>
function isUrl(s) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
return regexp.test(s);
}
isUrl(yourURL);
</script>