为什么$(xmlContent).find(“..”)。text()返回空字符串?

时间:2013-09-11 18:51:28

标签: jquery ajax

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

    }
 });

}

谢谢

0 个答案:

没有答案