我的表choosen_emails_1
,choosen_emails_2
,choosen_emails_3
,booking_address
,booking_number
,booking_message
,{{1} },booking_date
和request_date
user_email
循环迭代并打印除for
和user_email
以外的所有内容
我在控制器类中使用了booking_number
语句来检查查询选择器是否选择了表中的所有列,并打印了所有9列
因此后端代码没有问题。谁能告诉我这个jquery是否有任何问题!代码
Println
data = "";
myfunction = function() {
$('.tablecontainer').show();
load();
}
load = function() {
$.ajax({
url: 'updatedservicerequests',
type: 'POST',
data: {}, // function to get the value from jsp page and send it to mapped class function//
success: function(response) { // if the backend process is success then the function will run by getting the response as its parameter//
alert(response.message);
data = response.data;
alert(response.data);
$('.tr').remove();
alert(response.data);
$(function() {
for (i = 0; i < response.data.length; i++) {
$("#table").append(response.data[i].user_email + "'>" + response.data[i].booking_number + " </td> <td> " + response.data[i].booking_address + " </td> <td> " + response.data[i].booking_date + " </td> <td> " + response.data[i].booking_message + " </td> <td> " + response.data[i].request_date + " </td> <td> " + response.data[i].chosen_emails_1 + " </td> <td> " + response.data[i].chosen_emails_2 + " </td> <td> " + response.data[i].chosen_emails_3 + "</br>");
}
//to prevent (contact-submit) button from submitting form data since submit button has default action of submitting form
$(document).ready(function() {
$('#contact-submit').click(function(e) {
return false;
});
});
}
});
},
error: function(response) {
alert("unable to pull up any service request");
}
});
答案 0 :(得分:2)
此行缺少这两个字段周围的/dev/urandom/
标签,并且缺少整行周围的<td>
标签。
<tr>
您也不应该在其中使用$("#table").append(response.data[i].user_email + "'>" + response.data[i].booking_number + " </td> <td> " + response.data[i].booking_address + " </td> <td> " + response.data[i].booking_date + " </td> <td> " + response.data[i].booking_message + " </td> <td> " + response.data[i].request_date + " </td> <td> " + response.data[i].chosen_emails_1 + " </td> <td> " + response.data[i].chosen_emails_2 + " </td> <td> " + response.data[i].chosen_emails_3 + "</br>");
,这甚至不是有效的标签,并且它当然不属于</br>
。
正确的代码是:
<table>