[EMAIL PROTECTED] a écrit :
> new Ajax.Request(window.location, {   method: "post",
> postBody: "pageAction=login" + "&username=" + escape($
> ("username").value) + "&password=" + escape($("password").value),
> onSuccess: function(e) {
> document.location=document.location;
> },
> onFailure: function(e) {
> alert("tesT:" + e.responseText);
> }

What I find absolutely fascinating with this code is that you seem to
use AJAX in order to achieve non-AJAX processing: once your AJAX request
succeeds, you reload the page (and with a rather devious JS line at
that!)...

I mean, the best way to do that is through a simple, vanilla POST
request (e.g. through a form) to the server side, which returns a HTTP
Location header on success...

-- 
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to