1) Add dataType:'json' as an attribute of your ajax call, or use $.getJSON
2) use Firebug / console.log to examine the response, make sure DATA is a
valid property of the response JSON

-- Josh



-----Original Message-----
From: James White [mailto:[email protected]] 
Sent: Wednesday, June 17, 2009 1:41 PM
To: cf-talk
Subject: CFC and jQuery


I am trying to call a query from a CFC using jQuery with the following code:

$(document).ready(
     function () {
        $.ajax({
        type: "GET",
        url: "SpellChecker.cfc?method=getTextMemoFields&returnformat=json
            &queryformat=column",
        data: datastring,
        success: 
                function(response) {
                        var resp = jQuery.trim(response);
                        alert(resp);
                }
        });
                        
});

When I look at the data inside an alert it looks exactly like it should.
However, when I try to get to the values inside of it (e.g. resp.DATA) it is
always undefined. Do I need to perform an extra step?  I appreciate any
advice I can get on this.

Thanks,

JW 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323610
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to