1

我认为这个问题很容易解决,但我无法自己解决。

我正在使用colorbox简单的ajax请求从服务器加载一些 html,如下所示:

$.colorbox({
            href: false,
            scrolling:false,
            html: function(){
                $.post("image/render_image", {data: cardData},
                    function(response){
                        alert("I got response!");
                    }, "json"
                );

                return "I got displayed before response got back :/";
            }
        });

现在我正在发送发布请求,只有在收到回复后,我才想返回一些回复,我htmlcolorbox怎么做?

4

1 回答 1

3

尝试以下操作:

$.colorbox({
    href: "image/render_image",
    data: {data: cardData},
    scrolling:false,
    onComplete: function() {
        // do what do you want
    }
});
于 2012-07-09T21:47:21.663 回答