有人可以帮我吗?错误在哪里?或如何在td
中放置链接?
var c = [];
$.each(resp, function(i, item) {
var a = $('<a>');
a.attr('title', "aaa");
a.attr('rel', "{handler: 'iframe', size: {x: 600, y: 400}}");
a.text("bbbbb");
a.addClass('modal toolbar');
c.push("<tr><td>" + item.libelle_client + "</td>");
c.push("<td>" + item.date_debut + "</td>");
c.push("<td>" + item.date_debut + "</td>");
c.push("<td>" +a + "</td>");
c.push("<td>" + item.date_fin + "</td></tr>");
});
使用这个我得到了这个
RENAULT 2020-03-27 2020-03-27 [对象Object] 2020-03-31
我喜欢有一个链接,而不是[object object]
谢谢
更改为
c.push("<td>" + a[0].outerHTML + "</td>");
这很脏,但是应该可以。