I'm trying to use Prototype to do some basic Ajaxy things for the
first time in ages, and have run into a problem that I've seen
reported before, but with no replies:

http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/152b95c89f7d7dc5/1478a6d7456c4df8?lnk=gst&q=oncomplete#1478a6d7456c4df8

I have a function like this to send an async request back to the
server (in my case Ruby+Rack+Sinatra, and I'm testing with Firefox 3.5
and whatever the current Linux Chrome build is):

function toggleAcknowledge(id) {
  updater = new Ajax.Request('/alert/'+id+'/acknowledge', {
    method:'post',
    onSuccess: function(response) {
      alert("Success");
    },
    onComplete: function(response) {
      alert("Complete");
    }
  });
};

I've found that when the Updater method is set to 'post', the
onSuccess and onComplete functions fire after 30 seconds, rather than
when the request has completed (which is pretty much instantly).  This
obviously means updates won't happen to my page etc.  It seems that
the 30 second delay corresponds to the HTTP/1.1 connection being
closed; while the connection is open but the request complete, the
callbacks don't fire.  If I change the method to 'get' I don't see
this problem.

Would appreciate some prototype veterans' ideas on how to fix / work
around it - my first instinct was to ask the browser to use HTTP/1.0
but I assume this is a bit too low-level - any better ideas on how to
handle it?

Thanks,

--
Matthew

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to