我希望用jquery创建一个表。
我有jquery的经典调用,但现在我有兴趣通过jquery创建te表。
有人可以帮帮我吗?
$.ajax({
url: "http://localhost:8081/getAllUrl",
type: 'GET',
success: function(listURL) {
$.each(listURL, function (i) {
console.log(listURL[i]);
});
}
});
listURL的返回示例
[
"https://www.mismarcadores.com/mobile/#android",
"https://itunes.apple.com/es/app/mismarcadores/id766477515",
"https://www.mismarcadores.com/#"
]
String的简单数组列表!
问候!
答案 0 :(得分:0)
对于一个简单的表,您可以构建:
$.ajax({
url: "http://localhost:8081/getAllUrl",
type: 'GET',
success: function (listURL) {
var table = $("<table>", { class: "simple-table" });
$.each(listURL, function (i) {
table.append("<tr><td>" + listURL[i] + "</td></tr>");
});
// or some other element
$("body").append(table);
}
});