我的ajax函数保持循环

时间:2012-01-20 06:42:25

标签: jquery ajax

我有这个ajax功能。成功响应后,ajax再次发送请求,然后循环。如果需要,我该怎么做假回报呢?

$(function () {
    $("#acts1").jstree({ 
    "html_data" : {
            "ajax" : {
                "url" : "ajax.php",
                "data" : function (n) { 
                    return { id : n.attr ? n.attr("id") : 0 };

                },

            } 
        },

        "plugins" : [ "themes", "html_data", "ui", "crrm","checkbox" ]
    })
});

1 个答案:

答案 0 :(得分:1)

知道php返回会有所帮助,但要记住的其他事情是“回声”比返回更好,如果你回显真或假,请确保将其包装在json_encode()中,以便它以可读格式发送给你的ajax