【发布时间】:2014-11-20 21:31:56
【问题描述】:
为了开发,我想在 localhost 上使用 Deezer Javascript SDK。我将应用程序域设置为localhost:8000,但它不起作用。我的 HTML 文件位于 localhost:8000:
<!DOCTYPE html>
<html>
<head>
<title>Deezer to Spotify</title>
</head>
<body>
<div id="dz-root"></div>
<script src="http://cdn-files.deezer.com/js/min/dz.js"></script>
<script src="DeezerToSpotifySwitcher.js" charset="utf-8"></script>
</body>
</html>
我的 javascript 文件:
DZ.init({
appId: '147671',
channelUrl: 'http://localhost:8000/DeezerToSpotifySwitcher.html'
});
DZ.login(function (response) {
if (response.authResponse) {
DZ.api('/user/me', function (response) {
alert('Good to see you, ' + response.name + '.');
});
} else {
alert('User cancelled login or did not fully authorize.');
}
}, { perms: 'basic_access,email' });
我必须设置什么应用程序域?我错过了什么吗?
【问题讨论】:
-
您是否尝试将developers.deezer.com 中的应用程序域更新为localhost:8000?它应该可以工作。
-
是的,我做到了,但没有帮助:(
标签: javascript localhost deezer