function foo() {
    console.log("enter foo(toplist) !!");
    $.get("controllers/topController.php",function(result){
        var recList1 = result[0];
        var recList2 = result[1];
        var recList3 = result[2];
        var parts = ["CPU", "CPU_price", "CPU_link", "motherboard", "motherboard_price", "motherboard_link", "GPU", "GPU_price", "GPU_link", "memory", "memory_price", "memory_link", "CPURadiator", "CPURadiator_price", "CPURadiator_link", "SSD", "SSD_price", "SSD_link", "HDD", "HDD_price", "HDD_link", "powerSupply", "powerSupply_price", "powerSupply_link", "case", "case_price", "case_link"]
        //top1
        for (let a=0;a<9;a++){
            let start = 27+a*3;
            let index = a*3;
            let p_name = recList1[parts[index]];
            let p_price = recList1[parts[index+1]];
            let p_link = recList1[parts[index+2]];
            if (p_name==="noneed"){
                document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
                document.getElementById(`u${start+1}_text`).innerHTML = '----';
            }
            else {
                document.getElementById(`u${start}_text`).innerHTML = `<a href="${p_link}" style="text-decoration: none;" target="_blank">${p_name}</a>`;
                document.getElementById(`u${start + 1}_text`).innerHTML = p_price;
            }
        }
        document.getElementById("u55_text").innerHTML = recList1["totalPrice"];
        let download_1 = $('#u17_text a').eq(0)[0];
        download_1.href = "recommendLists/Recommend_"+recList1['id']+".txt";
        download_1.download = "Recommend_top1.txt";
        //top2：
        for (let b=0;b<9;b++){
            let start = 64+b*3;
            let index = b*3;
            let p_name = recList2[parts[index]];
            let p_price = recList2[parts[index+1]];
            let p_link = recList2[parts[index+2]];
            if (p_name==="noneed"){
                document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
                document.getElementById(`u${start+1}_text`).innerHTML = '----';
            }
            else {
                document.getElementById(`u${start}_text`).innerHTML = `<a href="${p_link}" style="text-decoration: none;" target="_blank">${p_name}</a>`;
                document.getElementById(`u${start + 1}_text`).innerHTML = p_price;
            }
        }
        document.getElementById("u92_text").innerHTML = recList2["totalPrice"];
        let download_2 = $('#u58_text a').eq(0)[0];
        download_2.href = "recommendLists/Recommend_"+recList2['id']+".txt";
        download_2.download = "Recommend_top2.txt";
        //top3：
        for (let c=0;c<9;c++){
            let start = 101+c*3;
            let index = c*3;
            let p_name = recList3[parts[index]];
            let p_price = recList3[parts[index+1]];
            let p_link = recList3[parts[index+2]];
            if (p_name==="noneed"){
                document.getElementById(`u${start}_text`).innerHTML = '<p style="text-decoration: none;" >----------------------------------------</p>';
                document.getElementById(`u${start+1}_text`).innerHTML = '----';
            }
            else {
                document.getElementById(`u${start}_text`).innerHTML = `<a href="${p_link}" style="text-decoration: none;" target="_blank">${p_name}</a>`;
                document.getElementById(`u${start + 1}_text`).innerHTML = p_price;
            }
        }
        document.getElementById("u129_text").innerHTML = recList3["totalPrice"];
        let download_3 = $('#u95_text a').eq(0)[0];
        download_3.href = "recommendLists/Recommend_"+recList3['id']+".txt";
        download_3.download = "Recommend_top3.txt";
    }, "json");


}