$j = $;
function refresh() {
    $j.ajax({
        url: "/api/QT/QT.ashx",
        data: { type: "cionbean" },
        dataType: "json",
        error: function () {
            $j("#user_get_gold").html(0);
            $j("#user_get_bean").html(0);
            $("#yongyoujinbi").html(0);
            $("#yongyoubadao").html(0);
        },
        success: function (sx) {
            if (sx == null) {
                return;
            }
            if (sx.error == "") {
                $j("#user_get_gold").html(sx.OBJ.coin);
                $j("#user_get_bean").html(sx.OBJ.bean);

                $("#yongyoujinbi").html(sx.OBJ.coin);
                $("#yongyoubadao").html(sx.OBJ.bean);

            } else {
                $j("#user_get_gold").html(0);
                $j("#user_get_bean").html(0);
                $("#yongyoujinbi").html(0);
                $("#yongyoubadao").html(0);
            }
        }
    })

}

$(window).ready(function () {
    refresh();
})