-3
var innerHtml ='<td>'+ getResponse[i].note +'</td>'
+ '<td>'+ getResponse[i].id +'</td>'
+ '<td>'+ getResponse[i].date +'</td>'
+ '<td>'+ '#' +'</td>';
var table = document.getElementById('table').getElementsByTagName('tbody')[0];
var newRow = table.insertRow(table.rows.length);
var newText = document.createTextNode(innerHtml);
newRow.appendChild(newText);
變量的innerHTML是HTML的innerHTML添加,但innerHTML的並不被看作HTML,它被視爲純文本...如何使純文本到HTML的JavaScript
你正在用'document.createTextNode(innerHtml)'把它變成一個文本節點。 – didierc
http://stackoverflow.com/questions/12653292/how-can-i-use-innerhtml-in-javascript – didierc