I know this can be done easily using jQuery but haven't been able to find out how to accomplish it with YUI 2.
I am submitting a form via AJAX and in the callback, on success, I want to add the information that was inserted into the existing table in the DOM.
This is what I am trying with no success:
var callback = {
success: function(o) {
var result = YAHOO.lang.JSON.parse(o.responseText);
if (result.success == true) {
var last_row = YAHOO.util.Dom.getLastChild('tbody_urls');
var html = '<tr><th>' + result.name
+ '</th><td><a href="' + result.url + '" title="' + result.url + '">' + result.url.substr(0, 80) + '</a></td><td></td><td></td></tr>';
var el = YAHOO.util.Dom.insertAfter(html, last_row); // el is being set to NULL so the insert is failing
YAHOO.util.Dom.get('form_urls').reset();
}
},
failure: function(o) { error(); }
};