A HTTP server returns a HTTP status code with every answer. The Ajax.Request object knowsabout 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 onthe Wiki page Martin mentioned.Note that your server-side web development framework should allow you to set these statuscodes. What do you use on the server?For more info about this, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html .-ThomasAm 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 questionOn 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
CiaoMartinOn 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 youOn 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.UpdaterHi,
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 Fuchswollzellequestentier on AIMmadrobby on irc.freenode.nethttp://www.fluxiom.com :: online digital asset managementhttp://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