views:

95

answers:

2

When I run the following XmlHttpRequest

$.get('../entries/find_most_recent',
    {name:$("#name").val()}, 
    function(data) {
        console.log("data");
    });

The result can be seen in this Firebug screenshot:

alt text

But when I remove the quotes from console.log("data"), like so:

$.get('../entries/find_most_recent',
    {name:$("#name").val()}, 
    function(data) {
        console.log(data);
    });

Nothing comes up in Firebug. The response is just a string, as can be seen in the screenshot above. How do I access it? Thanks for reading.

+1  A: 

The object returned needs to be determined and dealt with appropriately.

From jquery.com "The success callback function is passed the returned data, which will be an XML root element, text string, JavaScript file, or JSON object, depending on the MIME type of the response. It is also passed the text status of the response."

http://api.jquery.com/jQuery.get/

brumScouse
A: 

I would have to say try setting your dataType to text in your $.get request and also double check "../entries/find_most_recent" for any errors (should their be an extension, like: ../entries/find_most_recent.cgi or .html or .php or etc.)

Lobabob