WebRoot/js/index.js

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/* $Id: index.js 15469 2008-12-19 06:34:44Z testyang $ */
var best_str = new Object();
var new_str = new Object();
var hot_str = new Object();

function init_rec_data()
{
    best_str[0] = document.getElementById("show_best_area") == null ? '' : document.getElementById("show_best_area").innerHTML;
    new_str[0] = document.getElementById("show_new_area") == null ? '' : document.getElementById("show_new_area").innerHTML;
    hot_str[0] = document.getElementById("show_hot_area") == null ? '' : document.getElementById("show_hot_area").innerHTML;
}

function get_cat_recommend(rec_type, cat_id)
{
    if (rec_type == 1)
    {
        if (typeof(best_str[cat_id]) == "string")
        {
            document.getElementById("show_best_area").innerHTML = best_str[cat_id];
            return;
        }
    }
    else if (rec_type == 2)
    {
        if (typeof(new_str[cat_id]) == "string")
        {
            document.getElementById("show_new_area").innerHTML = new_str[cat_id];
            return;
        }
    }
    else
    {
        if (typeof(hot_str[cat_id]) == "string")
        {
            document.getElementById("show_hot_area").innerHTML = hot_str[cat_id];
            return;
        }
    }
    Ajax.call('index.php?act=cat_rec', 'rec_type=' + rec_type + '&cid=' + cat_id, cat_rec_response, "POST", "TEXT");
}

function cat_rec_response(result)
{
    var res = result.parseJSON();
    if (res.type == 1)
    {
        var ele = document.getElementById("show_best_area");
        best_str[res.cat_id] = res.content;
    }
    else if (res.type == 2)
    {
        var ele = document.getElementById("show_new_area");
        new_str[res.cat_id] = res.content;
    }
    else
    {
        var ele = document.getElementById("show_hot_area");
        hot_str[res.cat_id] = res.content;
    }
    ele.innerHTML = res.content;
后面还有 27 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。