What I did on a page I was working on was just simply make a page
refresh after the ajax was finished, didn't really go with the whole
update thing, but the ajax call was still great so the page doesnt
need refreshing if I input a faulty password.
If this is ok then you could just do a
function(data) {
if (data.indexOf("_ERROR_") == -1){
window.location = window.location;
} else {
//display error info
}
}
So if the loginpage returns a "_ERROR_" the page doesn't refresh.
I did it this way because it would be ALOT of changes everywhere, and
this way was just alot easier.
If you only want a admin menu or something, just load in the menu in
the callback
function(data) {
if (data.indexOf("_ERROR_") == -1){
$("adminmenu").load("the_admin_controls.php");
} else {
//display error info
}
}
Just make sure that the menu can't be loaded if the session isn't set
or whatever authentication you're using (SERVER-SIDE!).
Hope this helps you, oh and why I chose to do window.location =
window.location insted of window.refresh(), is just because some forms
don't submit with ajax, and if a visitor tried to login after
submiting a entry to the guestbook the entry would be resubmitted on a
successful login.
(btw, none of this is tested so there might be typos here and there,
but you get the idea)
// Kristinn
On 4/6/07, phutte <[EMAIL PROTECTED]> wrote:
..also, it looks like shit in Internet Explorer, please favor Firefox!