AJAX w/ Ext JS

Needing to retrieve just a simple string from an AJAX call using Ext JS and put it inside of a span, here's what I came up with. I am retrieving a single record from XML generated from a ColdFusion CFC.


function updateName(ValueX) {
    if (ValueX) {
        Ext.get("SpanX").update("");
        Ext.Ajax.request({
                         url: 'x_gateway.cfc',
                         params: {method:'getMethodX', name:ValueX},
                         method: 'POST',
                         success: updateContent,
                     failure: function ( result, request) {
                             Ext.MessageBox.alert('Failed', 'There was an error');
                     }
                         });
    }
}

function updateContent(result,request) {
    var readerX = new Ext.data.XmlReader({record: 'record'},
            [{name: 'email'}]);
    
    var resultX = readerX.read(result);
    
    Ext.get("SpanX").update("resultX .records[0].data.email);
}

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner