My method for accessing a json url is as follows and it works, but now I want to run the json with a for and its'.lenght' but I could not.
The json I want to get the urls from is the following
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js</scr>
<div id="success">
<div id="artisturl"></div>
</div>
$.ajax({
type : 'GET',
url : 'https://api.spotify.com/v1/search',
data : {'q':'coldplay',
'type':'artist'
},
dataType : 'json',
success : function(data) {
$('#success #artisturl').html(data.artists.items[0].uri) ;
},
}) ;