public/client.js
// function to validate url before submission
function to validate url before submission
function to validate url before submission
function urlIsValid(url){
  let urlExpr = new RegExp('((http)s?|ftp):\\/\\/(\\w+\\.)?\\w+\\.\\w+\\/?(\\w+(-\\w+)*(\\.\\w+(\\?\\S+)?)?)?');
  if(url.match(urlExpr)){
    return true;
  }else{
    return false;
  }
}
function urlIsValid ( url ) { let urlExpr = new RegExp ( '((http)s?|ftp):\\/\\/(\\w+\\.)?\\w+\\.\\w+\\/?(\\w+(-\\w+)*(\\.\\w+(\\?\\S+)?)?)?' ) ; if ( url . match ( urlExpr ) ) { return true ; } else { return false ; } }
function to validate url before submission
function to validate url before submission