Looking to develop a custom client for last.fm? Find your music "station" feed in JSON format here: .
However, encountering an issue when trying to access it using $.getJSON()
:
The 'Access-Control-Allow-Origin' header is not present on the requested resource. Origin '' is restricted from accessing it.
Facing a CORS problem with last.fm's end. Experimented with various solutions:
- AJAX. Fails due to Access-Control-Allow-Origin error.
- An iframe with document.domain set as "www.last.fm" or "last.fm". Encounter SAMEORIGIN iframe error.
- JSONP. Not supported with this feed.
- A
<script>
tag with src linked to the feed link. However,$('#scriptTagId').html()
remains empty. - Attempted Flash but facing cross-origin issues.
- Considering Java applet, yet concerns about size and cross-origin problems persist.
Pondering the use of a web proxy where the client employs a server-side proxy to fetch the feed, but desiring a pure client-side application without any server involvement. Aim to host on a CDN (S3 + Cloudfront).
Is there any workaround for this dilemma?