0

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.

2
  • 1
    isn't this a violation of the cross-domain ajax request policy? usejquery.com/posts/9/the-jquery-cross-domain-ajax-guide Commented Aug 11, 2011 at 4:40
  • @Stefan I'm using a plugin that uses yql. Can you request an XML document using jsonp? Commented Aug 11, 2011 at 4:42

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

1 Comment

+1 for using YQL to get around crossdomain policy. I've use PHP+CURL and YQL both (when I don't control the xml). Nice mention.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.