I have a dictionary with (key,value) inside my jquery success function,
$.each(myDictioary, function (key, value) {
alert(key + ' is ' + value);
}
I want all the Dictionary values in a var So I can append it my table..I have tried this so far, which didn't help..
var row = "";
$.each(myDictioary, function (key, Value) {
row+ = "<td>"+value+"</td>"
});
$("#tableBodyId")
.append($('<tr>')
.append($('<td>').text(row))
)
But I think I am doing something wrong when I'm concatenating <td>.
row+
Please let me know how I can get all values from dictionary into my var row..
Several problems
The concatenation operator
+=should not have spaces in it.You are creating an html string with multiple
<td>in it but then appending a single<td>whosetextis that html stringTry
This assumes that you are only adding one row.
More details would need to be given if your dictionary contains data for more than one row