我正在IE上测试一个应用程序。
当读取(动态(表时,我在读取"字符"时遇到问题。
list.forEach(item=>{
let child = document.createElement("tr");
child.innerHTML = `<td>${item.id}</td><td>${item.name}</td><td>${item.password}</td><td>${item.email}</td><td>${item.sex}</td><td>${item.country}</td><td>-</td><td>-</td>`;
table.appendChild(child);
})
如果可以修复,我该怎么做?
IE支持ES5。
你将不得不重写你的代码。
list.forEach(item=>{
let child = document.createElement("tr");
child.innerHTML = '<td>'+item.id+'</td><td>'+item.name+'</td><td>'+item.password+'</td><td>'+item.email+'</td><td>'+item.sex+'</td><td>'+item.country+'</td><td>-</td><td>-</td>';
table.appendChild(child);
})