How your back end reports the failure is up to you. You can pass back nothing, a 0, a 1, words, etc. Its your business logic at that point and completely arbitrary.

 

-Andrew Martinez

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Il Neofita
Sent: Wednesday, June 28, 2006 12:42 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] Ajax.Updater

 

I cannot understand something

with declaring this object new Ajax.Request I will request the page /my/url
however, on the server side, how should look the files? I canno tunderstand how can I give a positive o negative feedback

Thank you and sorry for these basic question

On 6/28/06, Martin Ström <[EMAIL PROTECTED] > wrote:

Something like this should do it:

new Ajax.Request("/my/url", {
    asynchronous: true,
    onSuccess: function(r) {
        $("myDiv").innerHTML = "updated! new contents " + r.responseText;
    },
    onFailure: function(r) {
        alert("failed!")
    }
})


See the docs ( http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request ) for more info

Ciao

Martin

 

On 6/28/06, Il Neofita <[EMAIL PROTECTED]> wrote:

Hi Andrew,
I am not so good in Java, can you send me a basic example.

Thank you

On 6/28/06, Martinez, Andrew < [EMAIL PROTECTED]> wrote:

Don't use Ajax.updater. Use the regular Ajax object and then pass in your own onSuccess function handler/function pointer/functor. The handler/pointer/functor will receive the response test in a HTTP request object and you can evaluate it there.

 

-Andrew Martinez

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Il Neofita
Sent: Wednesday, June 28, 2006 10:49 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] Ajax.Updater

 

Hi,
someone can help me, I am ot able to find the way how to user Ajax.updater to test if the request give some positive or negative result.
I am able only to return the result inside a div.
An example is appreciated.


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

 


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

 

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to