开发者

Consuming Rest Web Service that returns XML via Javascript and/or PHP

开发者 https://www.devze.com 2023-01-28 11:49 出处:网络
I have a web service I would like to consume with Javascript. I\'ve tried reading all the documentation on Jquery to do this using JSONP, however I believe th开发者_开发技巧is is only for Web Services

I have a web service I would like to consume with Javascript. I've tried reading all the documentation on Jquery to do this using JSONP, however I believe th开发者_开发技巧is is only for Web Services that return JSON data?

A few questions. I have a web service that returns XML, it's a Rest web service. Do I have to use an XML client or if I try to use a JSON client will it just "figure it out"?

Is there a way to return Cross Site web services via Jquery via javascript in XML? I can't seem to find an example anywhere.


jQuery can load XML via ajax. http://api.jquery.com/jQuery.ajax/ Search for "dataType", there is an xml option. I believe you can use jQuery selectors to pull data out of the XML. I don't think there is a way to deserialize the XML to an object as part of jQuery, you'll need to extract the XML information manually.

0

精彩评论

暂无评论...
验证码 换一张
取 消