我想用一个使用追加功能的Javascript创建一个列表。用Javascript添加列表追加
我有一个index.php文件,script.js文件和一个search.php文件,使MySQL查询。
我知道这一切工作,但布局不是最好的。所以我想如何让布局更好。
我希望它显示为列表,这应该用CSS或表来完成?
现在,它只是显示了这样414622570992222
this.number = 70992222 this.code = 4146225
所以我希望它喜欢就好什么是没有这样的寄宿生名单(不边界)。
----------------------
| Number | Code |
----------------------
| 70992222 | 4146225 |
----------------------
以下是我的script.js文件中的一些代码。
$.each(data.results, function(){
//Give the list element a rel with the data results ID incase we want to act on this later, like selecting from the list
$('#results-list').append("<li rel='" + this.number + "'>" + this.code + this.number + "</li>");
而且这是在我的index.php文件
<div id='results-holder'>
<ul id='results-list'>
我会用一个表,表格数据。 – ComFreek