0

为什么 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 

    }
 });

}

谢谢

4

0 回答 0