Use jQueryForm XHR as HTML
<p>I have this JS code (using jQuery Form plugin):</p>

<pre><code>    function doLogin(responseText, statusText, xhr, $form)  {
        var userbox = $(xhr).html();
        console.log(userbox);
    }
</code></pre>

<p>I want to use <code>userbox</code> as a html, so I could cut out some part of it (using <code>find()</code>). What am I doing wrong here?</p>

<hr>

<p>Full login code:</p>

<pre><code>$('#loginForm').submit(function() {
    $(this).ajaxSubmit({
        'success': doLogin,
        'error': showError
    });

    function showError() {
        $('#loginForm').append('&lt;div class="errorMessage" style="display:none"&gt;Błędny login lub hasło.&lt;/div&gt;');
        $('.errorMessage').fadeToggle();
    }

    function doLogin(responseText, statusText, xhr, $form)  {
        var userbox = $(responseText).html();
        console.log(userbox);
    }

    return false;
})
</code></pre>
