I've just start playing about with jQuery and want to place the results of a ajax call into a table ... I've written the following function (for test not actual)
function AjaxSucceeded(result) {
$("#pageLabel").html('');
$("#pageLabel").append($("<table>").attr("id", "outputTable").append($('<tbody>')));
$.each(result.d, function(i, item) {
$("#outputTable").find('tbody')
.append($('<tr>')
.attr('onclick', "clientSideInclude('pageLabel','http://wwww.microsoft.com');")
.append($('<td>')
.attr('colspan', "2")
.text(item.Description)
)
);
});
//** Clean up before we leave
$('#loadDiv').removeClass('Loading').addClass('notLoading');
};
Which produces the following output
<tbody><tr onclick="clientSideInclude('pageLabel','http://wwww.microsoft.com')"><td colspan="2">Test Page </td></tr><tr onclick="clientSideInclude('pageLabel','http://wwww.microsoft.com')"><td colspan="2">Test Page 2 </td></tr></tbody>
All looks good to me ... but the onclick even doesn't fire .... any ideas as how to fix this ? Thanks