Aborting Ajax.Request

21 views
Skip to first unread message

matte

unread,
Aug 15, 2008, 6:55:37 PM8/15/08
to Ruby on Rails: Spinoffs
Hi everyone,

I have found a way to cancel an Ajax.Request. Just wanted to know if
there is an already solution for this, or a better one?

Here is the code:

var axConnection;
new Ajax.Request('sample.php', {
onCreate: function(request)
{ axConnection = request; },
});
axConnection.transport.abort();

PS: When I abort the connection the way above, Ajax.Request fires
onSuccess event. Is there a way to avoid that?

Thank you!
Reply all
Reply to author
Forward
0 new messages