Cheap Plane Tickets - Credit Card Consolidation - Credit Card Consolidation - Anime - Personal Loans

PDA

View Full Version : Complete page using AJAX is it possible ?


seenms
Jan 30th 2008, 9:19 am
Hi,
've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve:

With AJAX you typically update/replace only parts of my page. But in
my application there are situation when I first notice on the server -
so AFTER sending an AJAX request - that I have to update the complete
page instead of only some parts. And what do I do now?
I don't have the option to use AJAX or not. My boss and our client wants
it, so the question is definitely "how", not "why".

Thanks!

MMJ
Jan 31st 2008, 9:39 am
document.body.innerHTML = ajax.responseText;

Something like that?

ltdraper
Feb 1st 2008, 6:51 am
Put a return code in your ajax function that tells you the entire page needs to be reloaded. Then either reload the page, or as MMJ points out, use Ajax to reload the entire page by calling a separate function.