How to store the XML response that we got from using an api in javascript?
I am trying to use an api , and I send a request asking for some data using the javascript . The server replies back with an xml data , which I don't know where to store or how to access开发者_StackOverflow社区 the XML . I can parse it using JSON , but need to know how to store the XML data first .
If that API you're using requires some sort of authentication, don't use Javascript for that. It's client-side code and all authentication shows up in it.
Matt Ball is right; you cannot "parse it using JSON". You can however have a PHP script perform that task for you with its xml_parser_*
functions.
精彩评论