Q:

web api 2 404 (not found) GET Ajax function

Hello I have this function of a simple validation to two inputs
Im using this function in the "IF" Of my Ajax Function and i get an 404 error
but when i remove this simple "IF" my AJAX Function is working perfect i would like for some help
    function signInValidation(userNameLogin, passwordLogin) {
    if (userNameLogin == "" || passwordLogin == "") {
        $(document).ready(function () {
            $("#effect").fadeIn(1000);
            $("#effect").fadeOut(2000);
        })
    }
}

And i Have this Function with AJAX GET 
    function GetUserLoginDetails() {
    $(document).ready(function () {
        $('#logInBtn').click(function (e) {

            var UserName = $('#_logInUserName').val();
            var Password = $('#_logInPassword').val();

            if (signInValidation(UserName, Password)){
                $.ajax({
                    url: 'http://localhost:56267/api/Users/GetUser' + '/' + UserName + '/' + Password,
                    type: 'Get',
                    dataType: 'json',
                    contentType: "application/json",
                    success: function (data, textStatus, xhr) {
                        console.log(data);
                        window.location.replace("http://localhost:59472/Views/UserPage.html");
                    },
                    error: function (xhr, textStatus, errorThrown) {
                        console.log('Error in Operation');
                    }
                })
            }
            e.preventDefault();
        })
    })
}

A:

The reason for your ajax not being run is due to your signInValidation isn't returning anything, the following is probably what you should modify your signInValidation method to:
function signInValidation(userNameLogin, passwordLogin) {
    if (userNameLogin == "" || passwordLogin == "") {
        $("#effect").fadeIn(1000);
        $("#effect").fadeOut(2000);
        return false;
    }
    else{
        return true;
    }
}

Your signInValidation method will now return true if a both a username and password are set, otherwise, it will return false, this will get checked in your if statement. 
Also, $(document).ready() should not be used in the manner you're using it. $(document).ready() get called when the document gets loaded, there should be no need to use within your signInValidation method. You can read up more about it here.

