我的html5代码是
<div id="tablpolicy" align="middle">
<div class="policydiv">
<div class="left">
<span>Policy No.</span>
</div>
<div class="right">
<label for="policyno" data-inline="true" id="policylbl"></label>
</div>
</div>
<div class="policydiv">
<div class="left">
<span>Quote No.</span>
</div>
<div class="right">
<label for="quoteno" data-inline="true" id="quotelbl"></label>
</div>
</div>
<div class="policydiv">
<div class="left">
<span>Product Name</span>
</div>
<div class="right">
<label for="productname" id="productlbl"></label>
</div>
</div>
</div>
我的jQuery代码是
$.ajax({
type:"GET",
url:"webservices.xml",
contentType:"text/plain; charset=UTF-8",
success: function(data){
var renewpolicy= $(data).find("renewpolicy");
var quotenumber=$(renewpolicy).find("QuoteNumber").text();
var policyno=$(renewpolicy).find("PolicyNumber").text();
var custid=$(renewpolicy).find("custid").text();
var productname=$(renewpolicy).find("ProductName").text();
}
})
我解析了 xml 文件并获取了 quotenumber、policyno、custid、productname 值。现在我想在表中的上述相应标签上显示这些标签值。如何将这些 xml 标签值设置为 abobe 标签以及我应该执行哪个事件使用?我们可以为此使用任何查询字符串吗?请帮我。提前致谢!!