我在创建排行榜时遇到麻烦,该排行榜可以正确地从Firebase调用数据,这是我到目前为止所掌握的。
function api_score_assembler(){
full_api_string = base_url + acces_level + "/" + api_ver + "/" + lang + "/games/" + year + "/" + season + "/" + season_week + "/schedule." + format + "?api_key=" + api_key;
console.log(full_api_string);
}
function api_wky_scores(){
$.ajax({
url: full_api_string,
method: "GET",
headers: {
'Access-Control-Allow-Origin' : '*',
'AcceAccess-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Origin, Content-Type, X-Auth-Token'
}
})
.then(function(response){
console.log(response);
response.sort(item.score)
response.forEach(item => {
<ul>
Team:
Score:
Rank:
</ul>
});
}