如何在表的一列中使用JQuery中的超链接


$(document).ready(function() {
$("#search_btn").click(function() {
var _empID = document.getElementById('search').value;
$.ajax({
url: 'coinsIndentsServlet?empid=' + _empID,
type: 'GET',
dataType: 'json',
timeout: 2500,
"columns": [{
"data": "INDENTNO",
"render": function(data, type, row, meta) {
return '<a href="Test.html' + data + '">' + data + '</a>';
}
}],
success: function(response) {
$('#table').bootstrapTable('load', response.indents);
$('#tabledata').bootstrapTable('load', response.egps);
}
});
});
});

如何使用jquery在mdbootstrap中超链接一列。这里iam使用上面的代码,但没有得到超链接。我只需要一列进行超链接。

您应该更改一点:

return '<a href="Test.html' + data + '">' + data + '</a>';

return '<a href="Test.html?test_id=' + data + '">' + data + '</a>';

输出:

如果data="0";1〃:

<a href='Test.html?test_id=1'>1</a>

你应该为链接找到一个更好的标题

最新更新