<script src="http://connect.soundcloud.com/sdk.js"></script>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
// initialize client with app credentials
SC.initialize({
client_id: 'bea6b4a2c1108a4cfa99f0d40966108a',
redirect_uri: 'http://www.samplewars.com/soundcloud'
});
// initiate auth popup
SC.connect(function() {
SC.get('/me', function(me) {
alert('Hello, ' + me.username);
});
});
</script>
Unsafe JavaScript attempt to access frame with URL http://samplewars.com/soundcloud/ from frame with URL http://www.samplewars.com/soundcloud/?code=77c9dc160d723a52f67d42a89067848e&state=SoundCloud_Dialog_80886#access_token=1-26934-195352-78151464de9a2ec39&scope=non-expiring. Domains, protocols and ports must match.
I'm getting this error in my chrome console, and in FF it just keeps looping through the allow process without shooting out the alert.
Funny thing is, it worked for a second, then I went to get a drink, came back, and it was broken.
edit: it also stays inside of the popup as opposed to closing back to the original window edit 2: it ALSO actually adds the permissions inside of soundcloud in the connect menu for the app. Just doesn't spit out the alert.
Edit 3: Okay, it works in FF now after I added an onclick event to stop it from constantly looping through the js. so now the code is:
<script src="http://connect.soundcloud.com/sdk.js"></script>
<script>
// initialize client with app credentials
SC.initialize({
client_id: 'bea6b4a2c1108a4cfa99f0d40966108a',
redirect_uri: 'http://www.samplewars.com/soundcloud'
});
// initiate auth popup
function connectSC(){
SC.connect(function() {
SC.get('/me', function(me) {
alert('Hello, ' + me.username);
});
});
}
</script>
<div id="connect_button" onClick="connectSC()">
connect to soundcloud
</div>
Which works in FF, but not in Chrome or IE.