为什么text()在MyPage.aspx上返回空字符串? .find和.filter会找到“imagesPaths”节点。
<script type="text/javascript" charset="utf-8">
function MyFunction(albumNb)
{
//xmlContent = "<images><imagePaths>2</imagePaths><imageTitles>title1,title2,title3,
//title4</imageTitles></images>"
$.ajax({
url: "MyPage.aspx?albumNb=1",
type: 'GET',
success: function (res) {
var xmlContent = res.xml;
$imagePaths = $(xmlContent).find("imagePaths").text(); //returns empty string, Why?
//$imagePaths = $(xmlContent).filter("imagePaths").text(); //also returns empty string
}
});
}
谢谢