Shorter way of writing my displayError() function?
I don't use Javascript, but i could write it in this way:

function displayError(display, string, xhr) 
{
    var args = arguments;
    var $error = $("div#error");
    var visible = $error.is(":visible");

    if (!display)
    {
        $error.slideUp();
    }
    else
    {

        if (visible) 
        {
            switch (args.length) 
            {
                case 1:
                case 2:
                    $error.fadeOut(function () 
                    {
                        $(this).html('&lt;b style="color: #ce1919;"&gt;(!)&lt;/b&gt; ' + string).fadeIn();
                    });
                    break;
                case 3:
                    $error.fadeOut(function () 
                    {
                        $(this).html('&lt;b style="color: #ce1919;"&gt;(' + xhr.status + ")&lt;/b&gt; " + string).fadeIn();
                    });
                    break;
            }
        } 
        else 
        {
            $error.html('&lt;b style="color: #ce1919;"&gt;(' + xhr.status + ")&lt;/b&gt; " + string).slideDown();
        }
    }
}


But why you use args.length == 1/2/3 if you don't do anything with it?
You could just write:

function displayError(display, string, xhr) {
    var $error = $("div#error");
    var visible = $error.is(":visible");
    var status = typeof xhr === "object" ? xhr.status : "!";

    if (display) {
        if (visible) {
            $error.fadeOut(function () {
                $(this).html('&lt;b style="color: #ce1919;"&gt;(' + status + ')&lt;/b&gt; ' + string).fadeIn();
            });

        } else {
            $error.html('&lt;b style="color: #ce1919;"&gt;(' + status + ")&lt;/b&gt; " + string).slideDown();
        }
    } else {
        $error.slideUp();
    }
}


I used var status = typeof xhr === "object" ? xhr.status : "!"; so you will get the status if xhr is an object, or ! if not.

I removed all typeof parts since i found it useless, you will always get a string so why you worry about it