Search Results

Search found 1 results on 1 pages for 'jiggabits'.

Page 1/1 | 1 

  • Origin null is not allowed by Access-Control-Allow-Origin

    - by JIGGABITS
    I'm currently working with the SoundCloud API and would like to have a track embed when a button is clicked. I get two errors: XMLHttpRequest cannot load http://soundcloud.com/oembed.json?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F48419073. Origin null is not allowed by Access-Control-Allow-Origin. AND Uncaught TypeError: Cannot read property 'html' of null Here is my code: <button onclick="getPopular()">+1</button> <div id="track"></div> <script src="http://connect.soundcloud.com/sdk.js" type="text/JavaScript"></script> <script type="text/JavaScript"> SC.initialize({ client_id: "**************", }); var getPopular = function() { SC.get("/tracks", {limit: 1}, function(tracks) { var track = tracks[0]; alert("Latest track: " + track.title); SC.oEmbed(track.uri, document.getElementById("track")); }); }; </script> I use an alert in my code to let me know that it is actually taking information from the SoundCloud API. I'm just not sure what else is preventing it from embedding. Thanks, ahead of time, or looking at my question. jiggabits

    Read the article

1