0
我正在尝试为Web应用程序设置SoundCloud SDK。 我设法得到一个弹出式窗口要求授权与下面的代码,点击连接,但它没有回应。如何为Web应用程序设置Javascript Soundcloud SDK
任何人都可以看到这个问题吗? 这是Javascript。
SC.initialize({
client_id: 'mygeneratedid',
redirect_uri: 'file:///Users/simonmellows/Documents/Music%20Tech%20(Year%203)/Individual%20Project/Work/GUI%20Design.html'
});
// initiate auth popup
SC.connect().then(function() {
return SC.get('/me');
}).then(function(me) {
alert('Hello, ' + me.username);
});
这是我的callback.html。
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Connect with SoundCloud</title>
</head>
<body onload="window.setTimeout(window.opener.SC.connectCallback, 1)">
<b style="text-align: center;">This popup should automatically close in a few seconds</b>
</body>
</html>
我在我的电脑上运行该文件,它不在其他地方托管。它是否需要在本地托管?甚至在远程服务器上工作? 任何意见将不胜感激。上面的代码就是我从文档中找到的。
谢谢!