Connecting Tech Pros Worldwide Help | Site Map

Ajax Response events do not fire , using Mongrel with Ruby andPrototype.

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 10th, 2007, 02:05 PM
maildmz@gmail.com
Guest
 
Posts: n/a
Default Ajax Response events do not fire , using Mongrel with Ruby andPrototype.

Goodafternoon,

I have got a minimum Mongrel instance running (see ruby code) and i am
hitting it with an Ajax request using Prototype. (see javascript code)

I get the 'onLoading' event, but the other events never fire. I am
getting the response because I can see the response from the Mongrel
server in my net monitor (Firebug). But the events itself never fire
(no oncomplete and or onfailure)

Can anyone see what I am doing wrong?
Do I need to add something more to the header in Mongrel?

Also i'm using the cross site ajax plugin to do cross Site Ajax calls.
(hence the crossSite:true) and trace does a write to the firebug
console.

Thank you very very much
kind regards,
Marco Kotrotsos

---------------------------------------------------------------------------------

//Javascript

function request() {

trace('start');
new Ajax.Request('http://localhost:3000/test', {
method: 'GET',
crossSite: true,

onLoading: function(transport) {
trace('onLoading' );
},
onComplete: function(transport) {
trace('onSuccess');
trace('The message is '+message);
},
onFailure: function() {
trace('onFailure');
}
});
}

//ruby

class SimpleHandler < Mongrel::HttpHandler
def process(request, response)
response.start(200) do |head,out|
head["Content-Type"] = "text/javascript"
out.write("var message = 'hello';\n")
end
end
end

h = Mongrel::HttpServer.new("127.0.0.1", "3000")
h.register("/test", SimpleHandler.new)
h.run.join

  #2  
Old December 10th, 2007, 02:55 PM
David Mark
Guest
 
Posts: n/a
Default Re: Ajax Response events do not fire , using Mongrel with Ruby andPrototype.

On Dec 10, 10:04 am, "mail...@gmail.com" <mail...@gmail.comwrote:
Quote:
Goodafternoon,
>
I have got a minimum Mongrel instance running (see ruby code) and i am
hitting it with an Ajax request using Prototype. (see javascript code)
>
You should ask in the Ruby spin-offs group.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.