Sorry to bother folks with what is probably a silly question, but I can't quite figure out the scope for livequery matched functions. For example, if I have the following:
$("#id:not(.inactive)").livequery(function() {alert(this);}) Then the alert shows <this> to be the matched selector, which is what I would expect. But if I have the following: $("#id").not(.inactive).livequery(function() {alert(this);}) Then the alert shows <this> to be the entire document. What's the reason for the difference in behavior? If anyone can explain this behavior, then it will probably let me figure out my real problem. In case someone has a lot of spare time, though, and wants to help with the root problem, here it is. I'm using ajax to load a lot of dynamically generated content, and I'm doing a fair bit of livequery processing on that content. The processing includes collapsing various sections of the content by hiding them. With a straightforward implementation, the browser briefly displays the entire (expanded) content before livequery has a chance to complete it's processing, so users are treated to an annoying "peek-a- boo" effect as the full content briefly appears and then collapses down to something more manageable. My approach for solving this problem is to deliver the content within a <div> wrapper with a css property of "display:none". As soon as the content arrives, I add a livequery handler that calls show() on the <div> wrapper. Since this handler goes to the end of the livequery queue, it fires only after all the other livequery processing is complete. Works like a charm on test pages where all the IDs are hard-coded. On the real page, though, the IDs aren't hard-coded, so I have to dynamically figure out which elements to show. I'm stuck on trying to find a handle to the content so that I can show it. I would expect <this> to be the delivered content in the matched function, but, instead, it's the entire document. TIA, Stephen P.S. This is on Safari if it matters. I've briefly tried Firefox and it seems to behave the same way, so I haven't done exhaustive testing other than in Safari.