我有一个这样的xml文件:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title />
<updated>2008-09-18T23:46:19.3857256Z</updated>
<author>
<name>Dino</name>
</author>
<id />
<content type="application/xml">
<m:properties>
<d:Message>Mountain View</d:Message>
<d:Age m:type="Edm.Int32">23</d:Age>
<d:AmountDue m:type="Edm.Double">200.23</d:AmountDue>
<d:BinaryData m:type="Edm.Binary" m:null="true" />
<d:CustomerCode m:type="Edm.Guid">c9da6455-213d-42c9-9a79-3e9149a57833</d:CustomerCode>
<d:CustomerSince m:type="Edm.DateTime">2008-07-10T00:00:00</d:CustomerSince>
<d:IsActive m:type="Edm.Boolean">true</d:IsActive>
<d:NumOfOrders m:type="Edm.Int64">255</d:NumOfOrders>
<d:PartitionKey>mypartitionkey</d:PartitionKey>
<d:RowKey>myrowkey1</d:RowKey>
<d:Timestamp m:type="Edm.DateTime">0001-01-01T00:00:00</d:Timestamp>
</m:properties>
</content>
我想在jQueryd:Message
element
中获取's ,我该怎么做?这是我的代码:value
$(document).ready(function () {
$.ajax({
type: "GET",
url: "Insert_Log.xml",
dataType: "xml",
success: parseXml
});
});
function parseXml(xml) {
$(xml).find("d:Message").each(function () {
$("#output").append($(this).text());
});
}
</script>
但它不起作用!我可以使用 javascript getElementsByTag("d:Message"
)获取价值,但我不知道如何使用jQuery