日期:2014-05-16 浏览次数:20630 次
var req ;
function createXDOM() {
req = new XMLHttpRequest();
var customer_id = $('#CUSTOMER_ID').val();
var url = "${ctx}/basedata/CustomerInfoAction!AjaxPer.action?id="+customer_id;
req.open("post",url,true);
req.send();
req.onreadystatechange=getInfoByName;
}
function getInfoByName() {
if(req.readyState==4){
//$('#contactList tr').remove();
var list = '${contactPersonInfo}';
alert(list);
/*
var html ='<c:forEach items="${contactPersonInfo}" var="contact">' +
'<tr>' +
'<td>'+($('#contactList tr').length+1)+'</td>' +
'<td>${contact.CUSTOMER_NAME}</td>' +
'<td>${contact.CUSTOMER_SEX}</td>' +
'<td>${contact.CUSTOMER_PROFESSION}</td>' +
'<td>${contact.CUSTOMER_CELL_PHONE}</td>' +
'<td>${contact.CUSTOMER_PHONE}</td>' +
'<td>${contact.CUSTOMER_ADDRESS}</td>' +
'<td>${contact.CUSTOMER_ZIP}</td>' +
'<td>${contact.CUSTOMER_HOBBY}</td>' +
'<td>${contact.CUSTOMER_EASY_TIME}</td>' +
'<td>${contact.CUSTOMER_EASY_CONTACT}</td>' +
'<td>否</td>' +
'</tr>'
'</c:forEach>'
*/
}
$('#contactList').before(html);
}
<table width="100%" border="0" style="margin-top: 0px"
cellpadding="0" cellspacing="0" class="tablel2" id="contacts">
<thead class="tittle_bg">
<tr>
<td>序号</td>
<td>联系人姓名</td>
<td>性别</td>
<td>职务</td>
<td>联系人手机</td>
<td>固定电话</td>
<td>联系人地址</td>
<td>邮编</td>
<td>爱好</td>
<td>方便联系时间</td>
<td>方便联系方式</td>
<td>是否主联系人</td>
</tr>
</thead>
<tbody id="contactList">
<c:choose>
<c:when test="${empty contactPersonInfo}">
<tr id="contactempty">
<td align="center" colspan="20">
<font color="red" >对不起,查到0条数据...</font>
</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach items="${contactPersonInfo}" var="contact">
<tr id="contactTr">
<td>${contact.ROWNUM}</td>
<td>
<a href="#" onclick="showDe