i think encapsulating your whole code with parantheses wont work
"( $('*').livequery(function(){ ..... }  ).andThen...."

you may use a plugin like this:

<div class="rating">1</div>
<div class="rating">2</div>
<div class="rating">3</div>

$.fn.andThen = function(cb) {
        cb.call(this);
        return this;
}

$(document).ready(function() {
        $('div.rating').livequery(function() {
                $('#log').append("<li>" + $(this).text() + "</li>");
                }).andThen(function(){
                        $('#log').append("<li>andThen</li>");
                });

});

but it wont work either as it is livequery's nature to instantly
return the chain and then "livequery" the dom
to callback your delegates, so its async. output: "andThen, 1, 2, 3"

trying to "extend" the callback-function itself using sth like:
Function.prototype.andThen = function(g) {
        var f=this;
        return function() {
                f.call(this);g.call(this);
        }
};
wont work either, as livequery executes the callback on "each()"
element found in the dom...
output: "1, andThen, 2, andThen, 3, andThen"
so i dont know a solution either, sorry.

so long,
kai

Reply via email to