Invalid javascript / JSONP response from Soundcloud API

When I include this URL as <script> in my HTML document, Chrome does not call my callback function, whereas it works fine for other URLs returned by soundcloud resolve api.

After a long investigation using Chrome Dev Tools, I finally found out that the javascript returned by this call fires SyntaxError (see screenshot below).

enter image description here

How can I get the callback function to be called as usual for this file?

+1
jsonp api google-chrome google-chrome-devtools soundcloud
source share
1 answer

DevTools actually point to the problem:

\ u2029 character in JSON

The response contains an invalid character ( \ u2028 ). SoundCloud messed it up. This JSONP response is not valid in all browsers.

To get around this, you can simply get the JSON file directly. SoundCloud CORS setup seems to allow this .

+1
source share

All Articles