I am creating a javascript string and am running into syntax errors. What’s the best way to put it?
'statement:'+var1+'<br /><table><thead><tr><th>head1</th><th>head2</th><th>head3</th></tr></thead><tbody>'+$.each(element,function(j){+'<tr><td>'+element[j][0]+'</td><td>'+element[j][1]+'</td><td>'+element[j][2]+'</td></tr>'+});+'</tbody></table>'
Where element is a json ojbect.
You need to declare the string and then later manipulate it with the
each()function: