Ustream API not working?
Ustream API not working?
我正在使用此代码来获取我的ustream状态。
<font color='red'><span id="status">status</span></font>
<script type="text/javascript">
function set_status(status)
{
if (status == "offline")
{
document.getElementById("status").innerHTML =
"offline";
}
else if (status == "live")
{
document.getElementById("status").innerHTML =
"LIVE";
}
else
{
document.getElementById("status").innerHTML =
"Error getting stream status!";
}
}
</script>
<script type="text/javascript"
src="http://api.ustream.tv/html/channel/codtelevision/getValueOf/status?key=MY KEY CODE=set_status">
</script>
出于某种原因,什么也没发生。我正在使用jsfiddle.net进行测试。。如果这有帮助的话。这是我的代码链接:
Jsfddle
在JSFiddle中,Javascript注释使用//
或/*
*/
注释,而不是<!--
-->
。这会导致语法错误,从而导致代码被忽略。
删除评论后,你会得到:
{"error": "Please use POST request"}
相关文章:
- $rootScope not working
- jQuery document.ready not working
- Javascript getElementsByTagName not working?
- JQuery.val( ) not working
- Tomcat websocket is not working
- Javascript JSON.parse not working
- NodeJS Multer is not working
- Regex not working
- Ember run.debounce not working
- AngularJs 1 not working
- document.getElementById.style.backgroundImage not working
- Rxjs5, distinct() is not working
- createOscillator noteOn not working
- Javascript - .getHours() not working
- Javascript setTimeout not working | onkeydown
- MongoDB $pull not working
- Express router.use not working
- JSONP not working
- window.opener not working in chrome & IE
- Backbone + RequireJS: Collection.each() is not working