How can I make a API request with the "search/setlist" endpoint from my HTML code?
How can I make a API request with the "search/setlist" endpoint from my HTML code?
Posted 8 Feb 2017, 13:52:33
Hello!
There is my problem. I try with my html code to make a request toward this website to get the information about a artist's setlists with this REST Endpoint: http://api.setlist.fm/docs/rest.0.1.search.setlists.html . But its always send me the message that the “Access-Control-Allow-Origin” header is missing. For help you to get a idea of what I'm trying to do, there is my code:
<button onclick=“lancer('http://api.setlist.fm/rest/0.1/search/setlists.xml?artistName=metallica/')”>setlist</button>
<script>
var lancer= function(url) {
}; xhr.send(); }
</script>
The alert show me that the xhr variable is “null”, proof that he don't get the XML file that I'm looking for and I got the error that I have been talking earlier. If someone could help me its very important cause I'll need this for one of my project.
Last edited 8 Feb 2017, 13:58:19