Answers for "check if url is valid jquery"

7

jquery check if url contains string

//If URL contains "mystring"
if (window.location.href.indexOf("mystring") > -1) {

}
Posted by: Guest on June-05-2020
1

jquery validator Url

$.validator.addMethod("UrlVal", function (value, element) {

            var Inicio_URL = ['http://www', 'https://www', 'www', 'ftp://www'];
            var Fim_URL = ['com', 'net', 'org', 'pt', 'eu','co'];

            var Url_Inserido = value.toLowerCase().split(".");

            if (Inicio_URL.includes(Url_Inserido[0])) {

                if (Fim_URL.includes(Url_Inserido[(Url_Inserido.length - 1)])) {
                    return true;
                } else
                    return false;

            } else
                return false;

        
        })
Posted by: Guest on November-10-2020

Code answers related to "check if url is valid jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language