ajax给<span>标签赋值,当时没变化
在ajax中的代码是
function LoadSelComInfo(companycode, addr_c, addr_e, labmail, txtComtel, txtemail) {
$.ajax({
type: "post",
cache: false,
dataType: "json",
url: "handler/LoadCompanyInfo.ashx",
data: {
companycode: companycode,
addr_c: addr_c,
addr_e: addr_e
},
beforeSend: function (XMLHttpRequest) {
//ShowMiniLoading2("#spLoading");
EnableControl();
},
success: function (data, textStatus) {
if (data) {
$("#spComAddr").html(data.Table[0].address_1);
$("#spComAddr_e").html(data.Table[0].address_2);
}
},
complete: function (XMLHttpRequest, textStatus) {
//StopMiniLoading2("#spLoading");
EnableControl();
window.close();
},
error: function () {
// StopMiniLoading2("#spLoading");
EnableControl();
window.close();
}
});
}
我用断点可以确认data的值是有的,
前台的代码是:
<td colspan="3" id="tdCompanyaddr" class="lv">
<span runat="server" id="spComAddr" ></span> <br />
<span runat="server" id="spComAddr_e"></span> <br/>
<input type="button" id="btncompanyaddr" value="选择" class="btn" onclick="ShowSelCompAddr()" />