I am at a complete loss, have been staring at this problem for almost
two hours...

In my rails controller, I do:

respond_to do |format|
      format.html
      format.js do
        render :json => {:foo => 'bar'}.to_json
      end
end

..  In my js file I do:
                        new Ajax.Request('/contacts', {
                                                                method: 'get',
                                                                onComplete: 
function(r) {
                                                                        
console.log(r.responseJSON);
                                                                }

                                                        });

and the console shows 'null'

...  Yet in firebug, if I click on the 'GET http://localhost:3000/contacts
200 OK 461ms':

{foo:'bar'}

Why is r.responseJSON not showing foo:'bar' in my js code???

-patrick

-- 
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-scriptacul...@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