我不太清楚我是否理解为什么最简单的HTML会给我这个错误: 线:1 错误:无法获取属性'appendChild'的值:object为null或undefined
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<TITLE>Sound Cloud demo</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<script src="http://connect.soundcloud.com/sdk.js"></script>
<script>
SC.initialize({
client_id: 'DMAlex'
});
SC.stream("/test", function(sound){
sound.play();
});
function SoundCloudCheck(){
alert('Ponit 1');
SC.stream("/test", function(sound){
sound.play();
});
alert('Ponit 2');
var track_url = 'http://soundcloud.com/forss/flickermood';
SC.oEmbed(track_url, { auto_play: true }, function(oEmbed) {
console.log('oEmbed response: ' + oEmbed);
});
}
</script>
</head>
<BODY>
Calling local application demo
<INPUT TYPE=BUTTON VALUE="Click me" NAME="Clk" onclick="SoundCloudCheck();" >
</BODY>
</html>
答案 0 :(得分:0)
添加
SC.connect(function(){
SC.get('/me', function(me) {
});
似乎摆脱了错误。