<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.

share|improve this question

feedback

1 Answer

Interesting factor. I found the issue, if you try to connect using an URL without www. as the prefix, it won't work. Soundcloud must require it in order to build the token

share|improve this answer
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.