Ajax返回上一页

I have a form inserted by jQuery Ajax to a page's div (say, 'content') and when the user finishes filling the form and hits 'submit' button, the result will be shown for further verification. The html and ajax code are as follows:

HTML:

<form id="userForm" action="..." method="post">
  ...
  ...
</form>

Ajax:

$(document).ready(function() {
  $('#userForm').ajaxForm({
    success: function(returnData) {
      $('#content').html(returnData);
    }
  });
});

The 'returnData' is the filled form (without input fields) for further confirmation. Now, how do I implement a 'back' button such that the user may go back and modify the previously entered data?

I am working on Google App Engine with Python. Thanks.

I wouldn't replace the form with new HTML.

I would rather hide the form with display: none and add the new HTML for viewing alongside. If you want to go back, then you can just hide the "viewing div" and show again the form, without the need to refill any input elements.

Something along these lines should work

HTML:

<div id="content">
    <div id="user-form-container">
        <form id="userForm" ...>...</form>
    </div>

    <div id="viewing-container"></div>
</div>

CSS:

#viewing-container {
    display: none;
}

The viewing part contains some sort of back-button, which hides the viewing area and shows the form again

jQ:

$(document).ready(function() {
    $('#userForm').ajaxForm({
        success: function(returnData) {
            $('#viewing-container').html(returnData);
            $('#user-form-container').hide();
            $('#viewing-container').show();
            $('#viewing-container #back-button').click(function() {
                $('#user-form-container').show();
                $('#viewing-container').hide();
            });
        }
    });
});