This is probably a no-brainer but I'm stuck.
I've a function which creates a table:
function getTable(someJSON, someGroup){
var table = $("<table>").attr("class", "someTable");
var row1 = $("<tr>");
var cell1 = $("<td>").text(someJSON.someThing);
row1.append(cell1);
var cell2 = $("<td>").text(someJSON.someThingElse);
row1.append(cell2);
var row2 = $("<tr>");
row2.append("<td>Something</td><td>Something else</td>");
table.append(row2);
var row3 = $("<tr>").append(getRow(someJSON, someGroup));
table.append(row3);
return table;
}
The table is returned okay but there's nothing in the last row.
getRow is like this:
function getRow(someJSON, someGroup){
$.ajax({
url: 'getRow.php',
data: ({
DM: JSON.stringify(someJSON),
someGroup: someGroup
}),
async: false
})
}
I've checked with FireBug and the getRow.php returns a valid result like: 123234 after doing it's thing but I'll be blown if I can get it into the ... I've been thrashing around with it and in an earlier iteration I had something like [object Object] appended to the row.
Any help would be greatly appreciated.
Cheers,
Dom