htmlテーブルのすべてのセルをループして、各rowOBjをtableOBJの新しいプロパティに追加すると、以下のようになりますが...。
var tableOBJ = {};
$("table tr").each(function (index, value) {
var r = new rowOBJ(
$(this).find('td').eq(0).text(),
$(this).find('td').eq(1).text()
);
tableOBJ[index] = r;
});
var p = JSON.stringify(tableOBJ);
p =
{
"0":{"name":"fdgd","surname":"ssdt"},
"1":{"name":"fdsf","surname":"vn"},
"2":{"name":"dfsb","surname":"mry"},
"3":{"name":"hsdsdfry","surname":"smh"}
}
以前の外観をjsonを次のようにするにはどうすればよいですか
{
{"name":"fdgd","surname":"ssdt"},
{"name":"fdsf","surname":"vn"},
{"name":"dfsb","surname":"mry"},
{"name":"hsdsdfry","surname":"smh"}
}