Thank you, now everything is clear.

On 6/29/06, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
A HTTP server returns a HTTP status code with every answer. The Ajax.Request object knows
about this, and will execute the onSuccess function only if a non-error status code was returned
(normally "200 OK"). You can also fine-tune this by using the various methods described on
the Wiki page Martin mentioned.

Note that your server-side web development framework should allow you to set these status
codes. What do you use on the server?


-Thomas


Am 28.06.2006 um 18:41 schrieb Il Neofita:

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

--
Thomas Fuchs
wollzelle


questentier on AIM
madrobby on irc.freenode.net
 
http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 _javascript_
http://mir.aculo.us :: Where no web developer has gone before





_______________________________________________
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