我正在嘗試使用livestream的非常有用的移動API,在http://www.livestream.com/userguide/?title=Mobile_API#Requesting_a_mobile_stream發現一個XML請求。我感興趣的是isLive響應值。我試圖用這樣有人可以幫助我使用livestream的api做出跨域xml請求嗎?
$.ajax({
type: "GET",
url: "http://xproshowcasex.channel-api.livestream-api.com/2.0/getstream",
datatype: "xml",
success: function(xml){
//this is where I need help. This is what I would like to happen
if (isLive == true) {
//perform action
}
else {
//perform other action
}
一個Ajax請求我使用在http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/發現插件進行跨域XML請求。任何人都可以告訴我這是否是最有效的方法?我一直沒有能夠得到它的工作。當我運行console.log(xml)(可能不正確)時,JS控制檯顯示objectObject,我認爲這意味着我需要解析數據?如果有人能花時間解釋這一點,我會很喜歡它。非常感謝。
真棒非常感謝您的幫助。 – davis