Simple XML parsing using jquery?
Sorry if this is similar to my other question, but I've been researching and I think I can phrase it better. I'm trying to parse the XML file found at开发者_如何转开发 http://xproshowcasex.channel-api.livestream-api.com/2.0/getstream All I am worried about is the isLive element. How can I make the isLive status an object so if it is true I can do one thing, and if it is false do another. The code below is pretty basic, but it's all I've got.
$.ajax({
type: "GET"
url: getstreamurl,
dataType: "xml",
success: function(xml) {
}
});
Thanks for your help.
This looks like it might not work because of the cross-domain request policy but here's a tutorial on XML parsing with jQuery: Parse XML with jQuery
If you're using YQL you can try out: http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/
The cross domain AJAX outputs JSONP via YQL which you can then import into your site. This will circumvent any cross-domain issues.
精彩评论