title: Soundcloud API Error NS_ERROR_DOM_BAD_URI: Access to restricted URI denied (JavaScript)
body: <p>I am just getting myself acquainted with Soundcloud's API and I am having some trouble. As far as I can tell, all I need in <code>SC.initialize</code> is a client_id. I have used the tutorials at Code Academy to get started and it was great. Now that I am actually trying to implement something I am running into some trouble.<br>
  When I ran my code in Code Academy, it did exactly what I wanted it to do. Now that I am trying to run it in a browser, I am getting a blank screen and this error: </p>
  
  <blockquote>
    <p>NS_ERROR_DOM_BAD_URI: Access to restricted URI denied @ <code>http://connect.soundcloud.com/sdk</code></p>
  </blockquote>
  
  <p>After doing some research, I have found that those errors are related to domain prefixes. So I tried changing it to http://<strong>www.</strong>connect.soundcloud.com/sdk. But when I do that, I get a different error: </p>
  
  <blockquote>
    <p><code>SC</code> is not defined</p>
  </blockquote>
  
  <p>AHHHH What am I doing wrong?!<br>
  I am new to using API's, and any help at all would be very greatly appreciated.<br>
  Here is what I am doing:<br>
  (JavaScript)</p>
  
  <pre><code>SC.initialize({
      client_id: 'hidden for privacy',
  });
  
  $(document).ready(function() {
      SC.get('/users/5577686/tracks', {limit:7}, function(tracks) {
          $(tracks).each(function(index, track) {
              $('#tracktitle').append($('&lt;li&gt;&lt;/li&gt;').html(track.title));
              $('#trackimage').append("&lt;img src='" + track.artwork_url + "' /&gt;");
              $('#play').append("&lt;a href='" + track.permalink_url + "' &gt;" + "Play" + "&lt;/a&gt;");
          });
      });
  });
  </code></pre>
  
  <p>(HTML)</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script src="http://connect.soundcloud.com/sdk.js"&gt;&lt;/script&gt;
          &lt;script src="soundcloud.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="tracktitle"&gt;&lt;/div&gt;
          &lt;div id="trackimage"&gt;&lt;/div&gt;
          &lt;div id="play"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I don't really think there is anything wrong with the code, as everything seemed to be working fine in Code Academy. I think it is more of an issue with familiarizing myself with the API. Do I need to do some further authentication? Do I need something more than just the client ID? Again I am very stuck and would appreciate any amount of help on this. Thanks for reading.</p>
  
  <p>(I also followed along with Coding for GOOD's Soundcloud API Integration tutorial step-by-step and I am getting the same exact errors, so this further confirms that the code is probably not the problem, but connecting to the API may be)</p>