Question: jQuery AJAX seems to be sending two requests. As I'm using a two-factor authentication method, based on time, the second request is failing hence the original request is "failing".

The first is a post request, that's fine, but then there's a GET request, which isn't fine. 

Here's the javascript I'm using to generate the query.

```
$('#form').live('submit', function(event) {
    var target = $('#ajax');
    var url = '/ajax/user/authenticateLevel3';
    $.ajax({
        type: "POST",
        url: url,
        data: $('#form').serialize(),
        dataType: 'json',
        success: function(data, status) {
            $.getJSON(url, function(data) {

                if (!data.resultCode) {
                $('#ajax').html($.base64.decode(data.html));
                $('#ajax').modal();
                } else {
                    location.reload();
                }

            });
        }
    });
    event.preventDefault();
});

```

Any ideas how I can work around this?

Answer: 
That is because you are doing 2 ajax calls (`.ajax` and `.getJSON`)

Try doing this instead (using document event delegation instead of `.live`):

```
$(document).on('submit', '#form', function(event) {
    var target = $('#ajax');
    var url = '/ajax/user/authenticateLevel3';
    $.ajax({
        type: "POST",
        url: url,
        data: $('#form').serialize(),
        dataType: 'json',
        success: function(data, status) {
            if (!data.resultCode) {
                $('#ajax').html($.base64.decode(data.html));
                $('#ajax').modal();
            } else {
                location.reload();
            }
        }
    });
    event.preventDefault();
});

```
You are sending 2 requests. One with .ajax and another with .getJson.

Remove the .getJson request. With no dataType property passed to .ajax, jquery will attempt to guess the response type. You may also specify the dataType as json to force the conversion. The 'data' parameter of the success callback should be converted to a javascript object for both of these options.