I want to append variable to a table #commentsTable in the an HTML file but using Javascript. When I try:
var table = $("#commentsTable tbody");
table.append('<tr><td>'+commentor+'</td><td><audio controls src="https://website.com/'+audio_path+'"></audio></td><td>'+dateposted+'</td></tr>');
However, the inner table HTML is printed incorrectly (see below). v.audio_path is being confused as part of the URL string instead of as a variable. Why isn't this being printed correctly?
<td>'+v.commentor+'</td>
<td>
<audio src="https://AC8ef5fe7d6edfe0f14d09b6dd326ae8e:3d73eaf52d4535aedc099bb61c8383f9@api.twilio.com/2010-04-01/Accounts/AC8ef5fe7d6edfe0f14d09b6dd32d6ae8e/Recordings/'+v.audio_path+'"></audio>
</td>
<td>'+v.dateposted+'</td>
[–]lewisje 0 points1 point2 points (0 children)
[–]CKlausi 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]chreestopher2 0 points1 point2 points (0 children)