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: 
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.
[`getJSON`](http://api.jquery.com/jQuery.getJSON) is an AJAX method for retrieving JSON from a server, not for processing the data returned by another ajax method. Just remove it.

```
$('#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) {
            if (!data.resultCode) {
            $('#ajax').html($.base64.decode(data.html));
            $('#ajax').modal();
            } else {
                location.reload();
            }
        }
    });
    event.preventDefault();
});

```

Since you mentioned you are switching over to [`.on`](http://api.jquery.com/on), the syntax will be like this:

```
$(parent).on('submit', '#form', function(event) {
    /*
     * ...
     */
});

```

where `parent` is the nearest static parent element of `#form`.