我正在尝试从json(根据响应)向列表视图添加行(匹配格式):
results : { _id: 53f8c48ddc1f5f0419f2ed53,
bName: 'Microsoft',
phone: 35588319,
Email: 'microsoft@gmail.com',
field: 'QA',
exp: '0-2',
__v: 0,
location: [ { longitude: 7.8, latitude: 7.8, _id: 53f8c48ddc1f5f0419f2ed54 } ] }end
列表:
<table summary="This table lists all the Jobs." cellpadding="40" cellspacing="40" vspace="40">
<caption id = "jobsListView" >
JOBS
</caption>
<thead>
<tr>
<th scope="col">Company Name</th>
<th scope="col">Contact</th>
<th scope="col">Email</th>
<th scope="col">Field</th>
<th scope="col">Exp</th>
</tr>
</thead>
<tbody>
<!-- every row = a row in the file
<tr>
<th scope="row">Microsoft</th> // comapny name
<td>0508558319</td> // contact
<td>Microsoft@mcsf.com (JFK)</td> // email
<td>QA (JFK)</td> // field
<td>0-2 (JFK)</td> // exp
</tr>
-->
</tbody>
</table>
bName =公司名称,电话=联系人...没有地址。然后我通过ajax发送ec:
$.ajax({
type: 'GET',
dataType: 'JSON',
url:'http://localhost:3000/find',
data: workerInfo,
success: function(jobs){
}
});