I was trying to pass tables using JSON as shown below.
sample.json
{
"title": "sample data",
"body": "<table border=\"1\" width=\"600\" bordercolor=\"#FFFFFF\"><tr><td>Column 1</td> <td>Column 2</td></tr></table>"
}
I used Javascript code to read the JSON file,
$.getJSON("sample.json", function(data) {
console.log(data);
});
But generates the following error
[JAVASCRIPT ERROR]
Error Detail : TypeError: body is undefined
Is it possible to pass tables in JSON?
The error lies somewhere else. The following jsfiddle proves that it works fine. http://jsfiddle.net/mendesjuan/YYPHe/
I removed the quotes around attributes just to avoid the escaping problems. It may be that your code is not properly escaping your quotes.