這裏是我在我的網站中使用的代碼。出於某種原因,我什麼都得不到Ustream狀態代碼是否損壞?
<div style="position:absolute; left:0px; top:0px; width:1200px; height:63px; opacity: 0;" ondrag="return false"; ondragstart="return false"; oncontextmenu="return false;"">
<img src="wpimages/wpa570f7e0.png" width="1200" height="63" border="0" id="statuslive" name="statuslive" title="" alt="" onload="OnLoadPngFix()" >
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
#statuslive {
display: block;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 100001;
padding: 0;
}
</style>
<script>
var query = 'http://api.ustream.tv/json/channel/codtelevision/getValueOf/status?key=my key only';
function run() {
$.getJSON(query, function (data) {
if (data['results'] == 'live') {
document.getElementById("statuslive").style.opacity = "1";
alert('Live');
} else {
document.getElementById("statuslive").style.opacity = "0";
alert('Offline');
}
});
clearTimeout(to);
setTimeout(run, 1000);
}
run();
</script>
即使我活着,圖像也不會顯示。我曾嘗試使用最新版本的jquery,但我仍然沒有形象。
這是我得到:
{"results":"offline","msg":null,"error":null,"processTime":true,"version":"mashery-r10"}
目前尚不清楚你實際上問。您是否從供應商那裏獲得意外的數據?這是你應該與供應商覈對的東西嗎?如果代碼本身出乎意料地行爲,請指出數據的位置和位置。 – David 2012-07-23 20:21:33
對不起,當我真的活的時候,圖像沒有出現。爲什麼人們低估了我的問題..我真的需要幫助 – 2012-07-23 20:23:03
降低價值可能是由於你對這個問題的困惑。在這種情況下,供應商回來的數據是什麼?你說你的圖片沒有顯示。但該圖像的條件取決於從外部源返回的數據。這些數據是什麼? 「a ==」是否居住「'?如果不是,什麼是'a'?如果您不提供更多信息,我們無法幫助您。 – David 2012-07-23 20:33:25