$(document).ready(function() {
var output = "<div>";
$.getJSON('https://search-a.akamaihd.net/typeahead/suggest/?solrformat=true&rows=20&callback=noCB&q=*%3A*+AND+schoolid_s%3A1255&defType=edismax&qf=teacherfirstname_t%5E2000+teacherlastname_t%5E2000+teacherfullname_t%5E2000+autosuggest&bf=pow(total_number_of_ratings_i%2C2.1)&sort=total_number_of_ratings_i+desc&siteName=rmp&rows=20&start=0&fl=pk_id+teacherfirstname_t+teacherlastname_t+total_number_of_ratings_i+averageratingscore_rf+schoolid_s&fq=&prefix=schoolname_t%3A%22University+of+Texas+at+Austin%22&callback=?' , function(data) {
for (var professor in data.noCB.response.docs) { //where the error might be
output += "a"
}
output += "</div>"
});
document.getElementById("listt").innerHTML = output;
});
This is the url that I call to get the JSON data :
This is the url with the data :
I get the error - noCB is not defined .
I guess I'm trying to access the JSON object the wrong way - but I'm unsure about the right way. Please let me know - I'm a beginner.