Is it possible to parse a SOAP response with a jQuery xml handler?

前端 未结 2 1184
生来不讨喜
生来不讨喜 2020-12-07 03:05

I have the following SOAP response:




        
2条回答
  •  情歌与酒
    2020-12-07 04:01

    You need to escape special characters (the colon) using double backslashes \\

    var xmlText = $(xml).find("soap\\:Envelope")
                        .find("soap\\:Body")
                        .find("getPurseBalanceResponse")
                        .find("getPurseBalanceResult")
                        .find("balance").text();
    console.log(xmlText);
    

    Here is a working fiddle.

提交回复
热议问题