You can use jQuery.load to re-request the same page (which should load the correct content since the session was created). It has support for loading part of the requested document.
Example:
function onSuccessfulLogin() {
$("#content").load(window.location.href + " #content");
}
EDIT: Oops, sorry, I think I misunderstood. I thought page A had content only visible to authenticated users, and you were showing a login form and wanted the correct content to show up once they authenticated.
If you just want the async. login, you can add a submit handler to the login form that submits the form to some sort of login handler script that returns whether their login attempt was successful.
$("#loginform").bind("submit", function () {
$.ajax({
url: "login.php",
method: "post",
cache: false,
dataType: "json", // for example
data: $(this).serialize(),
success: function (data) { // data is the JS object based on the JSON returned
if (data.success) {
$(this).fadeOut();
} else {
alert("bad login: "+data.error);
}
}
});
return false;
});